[GHA] Akamai cache purging adoption for linux runner - adjust script
This commit is contained in:
12
.github/actions/akamai-purge-osx/action.yml
vendored
12
.github/actions/akamai-purge-osx/action.yml
vendored
@@ -17,7 +17,7 @@ runs:
|
|||||||
echo -e "${EDGERC}" > ~/.edgerc
|
echo -e "${EDGERC}" > ~/.edgerc
|
||||||
wget -O akamai https://github.com/akamai/cli/releases/download/v1.5.6/akamai-v1.5.6-linuxamd64
|
wget -O akamai https://github.com/akamai/cli/releases/download/v1.5.6/akamai-v1.5.6-linuxamd64
|
||||||
chmod +x akamai
|
chmod +x akamai
|
||||||
akamai install purge
|
./akamai install purge
|
||||||
- name: Purge
|
- name: Purge
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -35,7 +35,7 @@ runs:
|
|||||||
if [ $new_length -ge $MAX ]; then
|
if [ $new_length -ge $MAX ]; then
|
||||||
echo "Batch from offset ${offset} of length ${length}"
|
echo "Batch from offset ${offset} of length ${length}"
|
||||||
batch=${urls:$offset:$length}
|
batch=${urls:$offset:$length}
|
||||||
akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $batch
|
./akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $batch
|
||||||
offset=$((offset + length))
|
offset=$((offset + length))
|
||||||
length=$((end - offset))
|
length=$((end - offset))
|
||||||
else
|
else
|
||||||
@@ -46,16 +46,16 @@ runs:
|
|||||||
length=$((${#urls} - offset + 1))
|
length=$((${#urls} - offset + 1))
|
||||||
echo "Last Batch from offset ${offset} of length ${length}"
|
echo "Last Batch from offset ${offset} of length ${length}"
|
||||||
batch=${urls:$offset:$length}
|
batch=${urls:$offset:$length}
|
||||||
akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $batch
|
./akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $batch
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Executing single Purge command..."
|
echo "Executing single Purge command..."
|
||||||
akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $urls
|
./akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $urls
|
||||||
fi
|
fi
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
rm -f ~/.edgerc
|
rm -f ~/.edgerc
|
||||||
akamai uninstall purge
|
./akamai uninstall purge
|
||||||
rm -f akamai-v1.5.6-linuxamd64
|
rm -f ./akamai
|
||||||
|
|||||||
Reference in New Issue
Block a user