Skip to content

Commit 0325f2a

Browse files
authored
ansible: promote release assets from staging r2 bucket (#3620)
Reference #3602
1 parent 19556d2 commit 0325f2a

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

ansible/www-standalone/tools/promote/_resha.sh

+29
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ site=$1
66
dstdir=$2
77
version=$3
88

9+
if [ "X${site}" == "X" ]; then
10+
echo "site argument not provided"
11+
exit 1
12+
fi
13+
914
if [ "X${dstdir}" == "X" ]; then
1015
echo "dstdir argument not provided"
1116
exit 1
@@ -16,6 +21,26 @@ if [ "X${version}" == "X" ]; then
1621
exit 1
1722
fi
1823

24+
if [ -z ${dist_rootdir+x} ]; then
25+
echo "\$dist_rootdir is not set"
26+
exit 1
27+
fi
28+
29+
if [ -z ${staging_bucket+x} ]; then
30+
echo "\$staging_bucket is not set"
31+
exit 1
32+
fi
33+
34+
if [ -z ${cloudflare_endpoint+x} ]; then
35+
echo "\$cloudflare_endpoint is not set"
36+
exit 1
37+
fi
38+
39+
if [ -z ${cloudflare_profile+x} ]; then
40+
echo "\$cloudflare_profile is not set"
41+
exit 1
42+
fi
43+
1944
(cd "${dstdir}/${version}" && shasum -a256 $(ls node* openssl* iojs* win-*/* x64/* 2> /dev/null) > SHASUMS256.txt) || exit 1
2045
if [[ $version =~ ^v[0] ]]; then
2146
(cd "${dstdir}/${version}" && shasum $(ls node* openssl* x64/* 2> /dev/null) > SHASUMS.txt) || exit 1
@@ -25,3 +50,7 @@ nodejs-dist-indexer --dist $dstdir --indexjson ${dstdir}/index.json --indextab
2550
find "${dstdir}/${version}" -type f -exec chmod 644 '{}' \;
2651
find "${dstdir}/${version}" -type d -exec chmod 755 '{}' \;
2752

53+
relativedir=${dstdir/$dist_rootdir/"$site/"}
54+
aws s3 cp ${dstdir}/index.json $staging_bucket/$relativedir/index.json --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
55+
aws s3 cp ${dstdir}/index.tab $staging_bucket/$relativedir/index.tab --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
56+
aws s3 cp ${dstdir}/${version}/SHASUMS256.txt $staging_bucket/$relativedir/${version}/SHASUM256.txt --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile

ansible/www-standalone/tools/promote/settings

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ chakracore_release_dirmatch=.*
3939

4040
cloudflare_endpoint=https://07be8d2fbc940503ca1be344714cb0d1.r2.cloudflarestorage.com
4141
cloudflare_profile=worker
42-
destination_bucket=s3://dist-prod
42+
staging_bucket=s3://dist-staging
43+
dist_bucket=s3://dist-prod

ansible/www-standalone/tools/promote/upload_to_cloudflare.sh

+9-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ if [ -z ${dist_rootdir+x} ]; then
2222
echo "\$dist_rootdir is not set"
2323
exit 1
2424
fi
25-
if [ -z ${destination_bucket+x} ]; then
26-
echo "\$destination_bucket is not set"
25+
if [ -z ${staging_bucket+x} ]; then
26+
echo "\$staging_bucket is not set"
27+
exit 1
28+
fi
29+
if [ -z ${dist_bucket+x} ]; then
30+
echo "\$dist_bucket is not set"
2731
exit 1
2832
fi
2933
if [ -z ${cloudflare_endpoint+x} ]; then
@@ -38,6 +42,6 @@ fi
3842
relativedir=${dstdir/$dist_rootdir/"$site/"}
3943
tmpversion=$2
4044

41-
aws s3 cp $dstdir/$tmpversion/ $destination_bucket/$relativedir/$tmpversion/ --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile --recursive --no-follow-symlinks
42-
aws s3 cp $dstdir/index.json $destination_bucket/$relativedir/index.json --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
43-
aws s3 cp $dstdir/index.tab $destination_bucket/$relativedir/index.tab --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
45+
aws s3 cp $staging_bucket/$relativedir/$tmpversion/ $dist_bucket/$relativedir/$tmpversion/ --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile --recursive --no-follow-symlinks
46+
aws s3 cp $staging_bucket/$relativedir/index.json $dist_bucket/$relativedir/index.json --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
47+
aws s3 cp $staging_bucket/$relativedir/index.tab $dist_bucket/$relativedir/index.tab --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile

0 commit comments

Comments
 (0)