[GHA] Akamai cache purging adoption for linux runner - adjust script

This commit is contained in:
aboyko
2024-04-28 14:15:52 -04:00
parent 2750fa3e7c
commit 980f0cca1a

View File

@@ -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