@@ -22,30 +22,18 @@ if [ -z ${dist_rootdir+x} ]; then
2222 echo " \$ dist_rootdir is not set"
2323 exit 1
2424fi
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"
25+ if [ -z ${prod_bucket+x} ]; then
26+ echo " \$ prod_bucket is not set"
3127 exit 1
3228fi
33- if [ -z ${cloudflare_endpoint+x} ]; then
34- echo " \$ cloudflare_endpoint is not set"
35- exit 1
36- fi
37- if [ -z ${cloudflare_profile+x} ]; then
38- echo " \$ cloudflare_profile is not set"
29+ if [ -z ${staging_bucket+x} ]; then
30+ echo " \$ staging_bucket is not set"
3931 exit 1
4032fi
4133
4234relativedir=${dstdir/ $dist_rootdir / " $site /" }
4335tmpversion=$2
4436
45- # Due to R2 limitations, `aws s3 cp` and `aws s3 sync` only succeed in copying
46- # different sets of files across. Fortunately the sets are disjoint, so running
47- # both commands (ignoring errors) will copy all the files across.
48- aws s3 cp $staging_bucket /$relativedir /$tmpversion / $dist_bucket /$relativedir /$tmpversion / --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile --recursive --no-follow-symlinks --copy-props none || true
49- aws s3 sync $staging_bucket /$relativedir /$tmpversion / $dist_bucket /$relativedir /$tmpversion / --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile --no-follow-symlinks || true
50- aws s3 cp $staging_bucket /$relativedir /index.json $dist_bucket /$relativedir /index.json --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
51- aws s3 cp $staging_bucket /$relativedir /index.tab $dist_bucket /$relativedir /index.tab --endpoint-url=$cloudflare_endpoint --profile $cloudflare_profile
37+ rclone copy $staging_bucket /$relativedir /$tmpversion / $prod_bucket /$relativedir /$tmpversion /
38+ rclone copyto $staging_bucket /$relativedir /index.json $prod_bucket /$relativedir /index.json
39+ rclone copyto $staging_bucket /$relativedir /index.tab $prod_bucket /$relativedir /index.tab
0 commit comments