Remove old s3 bucket (dist.springsource.com) in GHA, Concourse, links
This commit is contained in:
27
.github/scripts/clear-s3-caches-file.sh
vendored
27
.github/scripts/clear-s3-caches-file.sh
vendored
@@ -1,27 +0,0 @@
|
||||
set -e
|
||||
|
||||
file=$1
|
||||
echo "Clearing S3 caches for file: ${file}"
|
||||
|
||||
#Flush AWS Cloudfront Cache
|
||||
invalidation_json=`aws cloudfront create-invalidation --distribution-id ECAO9Q8651L8M --output json --paths "/${file}"`
|
||||
echo "Invalidation response: ${invalidation_json}"
|
||||
invalidation_id=`echo $invalidation_json | jq -r '.Invalidation.Id'`
|
||||
invalidation_status=`echo $invalidation_json | jq -r '.Invalidation.Status'`
|
||||
echo "ID=${invalidation_id} Status=${invalidation_status}"
|
||||
while [ "${invalidation_status}" == "InProgress" ]
|
||||
do
|
||||
echo "Invalidation status: ${invalidation_status}"
|
||||
sleep 3
|
||||
invalidation_status=`aws cloudfront get-invalidation --distribution-id ECAO9Q8651L8M --id $invalidation_id --output json | jq -r '.Invalidation.Status'`
|
||||
done
|
||||
echo "Final invalidation status: ${invalidation_status}"
|
||||
|
||||
# Flush CloudFlare Cache
|
||||
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/purge_cache" \
|
||||
-H "X-Auth-Email: spring-sysadmin@pivotal.io" \
|
||||
-H "Authorization: Bearer ${CLOUDFLARE_CACHE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data "{\"files\": [ \"http://dist.springsource.com/${file}\" ] }"
|
||||
|
||||
|
||||
64
.github/scripts/clear-s3-caches.sh
vendored
64
.github/scripts/clear-s3-caches.sh
vendored
@@ -1,64 +0,0 @@
|
||||
set -e
|
||||
|
||||
s3_path=$1
|
||||
|
||||
echo "Clearing S3 caches for path: ${s3_path}"
|
||||
|
||||
#Flush AWS Cloudfront Cache
|
||||
invalidation_json=`aws cloudfront create-invalidation --distribution-id ECAO9Q8651L8M --output json --paths "/${s3_path}/*"`
|
||||
echo "Invalidation response: ${invalidation_json}"
|
||||
invalidation_id=`echo $invalidation_json | jq -r '.Invalidation.Id'`
|
||||
invalidation_status=`echo $invalidation_json | jq -r '.Invalidation.Status'`
|
||||
echo "ID=${invalidation_id} Status=${invalidation_status}"
|
||||
while [ "${invalidation_status}" == "InProgress" ]
|
||||
do
|
||||
echo "Invalidation status: ${invalidation_status}"
|
||||
sleep 3
|
||||
invalidation_status=`aws cloudfront get-invalidation --distribution-id ECAO9Q8651L8M --id $invalidation_id --output json | jq -r '.Invalidation.Status'`
|
||||
done
|
||||
echo "Final invalidation status: ${invalidation_status}"
|
||||
|
||||
# Flush CloudFlare Cache
|
||||
s3_url=s3://dist.springsource.com/${s3_path}
|
||||
files=`aws s3 cp ${s3_url} . --recursive --include "*" --dryrun`
|
||||
counter=0
|
||||
json=""
|
||||
NL=$'\n'
|
||||
FILES_BATCH=7
|
||||
for file in $files
|
||||
do
|
||||
if [[ "$counter" -eq 0 ]]; then
|
||||
json="{\"files\": [${NL}"
|
||||
fi
|
||||
if [[ "$file" =~ ^"s3://dist.springsource.com" ]]; then
|
||||
echo "Processing ${file}"
|
||||
counter=$((counter+1))
|
||||
path=${file:26}
|
||||
json="${json}\"http://dist.springsource.com${path}\",${NL}\"https://dist.springsource.com${path}\",${NL}\"http://download.springsource.com${path}\",${NL}\"https://download.springsource.com${path}\",${NL}"
|
||||
fi
|
||||
if [[ "$counter" -eq "$FILES_BATCH" ]]; then
|
||||
json="${json%,*}${NL}]}"
|
||||
echo $json
|
||||
|
||||
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/purge_cache" \
|
||||
-H "X-Auth-Email: spring-sysadmin@pivotal.io" \
|
||||
-H "Authorization: Bearer ${CLOUDFLARE_CACHE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data "${json}"
|
||||
|
||||
json=""
|
||||
counter=0
|
||||
fi
|
||||
done
|
||||
if ! [[ "$counter" -eq 0 ]]; then
|
||||
json="${json%,*}${NL}]}"
|
||||
echo $json
|
||||
|
||||
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/purge_cache" \
|
||||
-H "X-Auth-Email: spring-sysadmin@pivotal.io" \
|
||||
-H "Authorization: Bearer ${CLOUDFLARE_CACHE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data "${json}"
|
||||
fi
|
||||
|
||||
|
||||
18
.github/scripts/update-distro-download-page.sh
vendored
18
.github/scripts/update-distro-download-page.sh
vendored
@@ -4,24 +4,6 @@ dist_path=$1
|
||||
eclipse_version=$2
|
||||
build_type=$3
|
||||
|
||||
# Legacy S3 tool-spring-io dist.springsource.com
|
||||
s3_url=s3://dist.springsource.com/${dist_path}
|
||||
downloads_html="sts4-nightly-${eclipse_version}.html"
|
||||
files=`aws s3 cp ${s3_url} . --recursive --exclude "*" --include "spring-tool-suite-4*.zip" --include "spring-tool-suite-4*.dmg" --include "spring-tool-suite-4*.self-extracting.jar" --include "spring-tool-suite-4*.tar.gz" --exclude "*/*" --dryrun`
|
||||
rm -f ./${downloads_html}
|
||||
echo '<ul>' >> $downloads_html
|
||||
for file in $files
|
||||
do
|
||||
if [[ "$file" =~ ^"s3://dist." ]]; then
|
||||
download_url=https://download${file:9}
|
||||
filename=${file:${#s3_url}+1}
|
||||
echo ' <li><a href="'${download_url}'">'${filename}'</li>' >> $downloads_html
|
||||
fi
|
||||
done
|
||||
echo '</ul>' >> $downloads_html
|
||||
cat ./$downloads_html
|
||||
aws s3 mv ./$downloads_html s3://dist.springsource.com/${build_type}/STS4/ --acl public-read --no-progress
|
||||
|
||||
# Akamai tools-spring-io bucket
|
||||
s3_url=s3://tools-spring-io/${dist_path}
|
||||
downloads_html="sts4-nightly-${eclipse_version}.html"
|
||||
|
||||
Reference in New Issue
Block a user