From 180b2c139e39dfc7c562d8bfedd04200b53696b0 Mon Sep 17 00:00:00 2001 From: aboyko Date: Mon, 31 Jul 2023 17:33:32 -0400 Subject: [PATCH] [GHA-Build] Debug cloudflare cache flush script --- .github/scripts/clear-s3-caches.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/clear-s3-caches.sh b/.github/scripts/clear-s3-caches.sh index 9c44a72b2..4051526d8 100755 --- a/.github/scripts/clear-s3-caches.sh +++ b/.github/scripts/clear-s3-caches.sh @@ -18,24 +18,25 @@ s3_url=s3://dist.springsource.com/${s3_path} files=`aws s3 cp ${s3_url} . --recursive --include "*" --dryrun` counter=0 json="" +NL=$'\n' for file in $files do echo "Processing ${file}" if [[ "$counter" -eq 0 ]]; then - json="{\"files\": [$'\n'" + json="{\"files\": [${NL}" fi echo "Current json: ${json}" if [[ "$file" =~ ^"s3://dist.springsource.com" ]]; then echo "Is a file in s3 ${file}" - let "counter++" + counter=$((counter+1)) echo "Counter ${counter}" path=${file:26} echo "Path ${path}" - json="${json}\"http://dist.springsource.com${path}\",$'\n'\"http://dist.springsource.com${path}\",$'\n'\"http://download.springsource.com${path}\",$'\n'\"https://download.springsource.com${path}\",$'\n'" + json="${json}\"http://dist.springsource.com${path}\",${NL}\"http://dist.springsource.com${path}\",${NL}\"http://download.springsource.com${path}\",${NL}\"https://download.springsource.com${path}\",${NL}" fi if [[ "$counter" -eq 10 ]]; then echo "Batch completed" - json="${json:-2}$'\n']}" + json="${json:-2}${NL}]}" echo $json json="" fi