GHA: Batch URIs to invalidate on Akamai

This commit is contained in:
aboyko
2023-11-17 11:33:53 -05:00
parent c7c6abfea7
commit b6a31bfe83

View File

@@ -31,12 +31,11 @@ runs:
for idx in $indices
do
end=${idx%:*}
echo "Index ${end}"
new_length=$((end - offset))
if [ $new_length -ge $MAX ]; then
echo "Batch from ${offset} of length ${length}"
echo "Batch from offset ${offset} of length ${length}"
batch=${urls:$offset:$length}
echo $batch
akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $batch
offset=$((offset + length))
length=$((end - offset))
else
@@ -45,9 +44,9 @@ runs:
done
if [ $length -gt 0 ]; then
length=$((${#urls} - offset + 1))
echo "Last Batch from ${offset} of length ${length}"
echo "Last Batch from offset ${offset} of length ${length}"
batch=${urls:$offset:$length}
echo $batch
akamai purge --edgerc ~/.edgerc --section ccu ${{ inputs.command }} $batch
fi
else
echo "Executing single Purge command..."