From e896c7855b675b76f184f1d8fbf40eba5b9a022a Mon Sep 17 00:00:00 2001 From: flakey5 <73616808+flakey5@users.noreply.github.com> Date: Sun, 28 Jan 2024 10:57:54 -0800 Subject: [PATCH] ansible: promote release assets from staging r2 bucket Note: nodejs/node#51394 should land before this does Reference #3602 --- ansible/www-standalone/tools/promote/settings | 3 ++- .../tools/promote/upload_to_cloudflare.sh | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ansible/www-standalone/tools/promote/settings b/ansible/www-standalone/tools/promote/settings index 17ddd827a..24342c1ce 100755 --- a/ansible/www-standalone/tools/promote/settings +++ b/ansible/www-standalone/tools/promote/settings @@ -39,4 +39,5 @@ chakracore_release_dirmatch=.* cloudflare_endpoint=https://07be8d2fbc940503ca1be344714cb0d1.r2.cloudflarestorage.com cloudflare_profile=worker -destination_bucket=s3://dist-prod +staging_bucket=s3://dist-staging +dist_bucket=s3://dist-prod diff --git a/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh b/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh index dc99ab182..df0205d18 100755 --- a/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh +++ b/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh @@ -22,8 +22,12 @@ if [ -z ${dist_rootdir+x} ]; then echo "\$dist_rootdir is not set" exit 1 fi -if [ -z ${destination_bucket+x} ]; then - echo "\$destination_bucket is not set" +if [ -z ${staging_bucket+x} ]; then + echo "\$staging_bucket is not set" + exit 1 +fi +if [ -z ${dist_bucket+x} ]; then + echo "\$dist_bucket is not set" exit 1 fi if [ -z ${cloudflare_endpoint+x} ]; then @@ -38,6 +42,6 @@ fi relativedir=${dstdir/$dist_rootdir/"$site/"} tmpversion=$2 -aws s3 cp $dstdir/$tmpversion/ $destination_bucket/$relativedir/$tmpversion/ --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile --recursive --no-follow-symlinks -aws s3 cp $dstdir/index.json $destination_bucket/$relativedir/index.json --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile -aws s3 cp $dstdir/index.tab $destination_bucket/$relativedir/index.tab --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile +aws s3 cp $staging_bucket/$relativedir/$tmpversion/ $dist_bucket/$relativedir/$tmpversion/ --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile --recursive --no-follow-symlinks +aws s3 cp $dstdir/index.json $dist_bucket/$relativedir/index.json --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile +aws s3 cp $dstdir/index.tab $dist_bucket/$relativedir/index.tab --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile