Skip to content

Commit

Permalink
use cross-region copy instead of upload where possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
c6fc committed Apr 2, 2021
1 parent dd35f76 commit 4cb938d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions terraform-selfhost/templates/upload_npkfile.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ echo "- Compressing"
echo "- Uploading to S3"
aws s3 cp $ARCHIVE s3://$BUCKET1/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION1
aws s3 cp $ARCHIVE s3://$BUCKET2/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION2
aws s3 cp $ARCHIVE s3://$BUCKET3/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION3
aws s3 cp $ARCHIVE s3://$BUCKET4/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION4
aws s3 cp s3://$BUCKET1/$1/$ARCHIVE s3://$BUCKET2/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION2
aws s3 cp s3://$BUCKET1/$1/$ARCHIVE s3://$BUCKET3/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION3
aws s3 cp s3://$BUCKET1/$1/$ARCHIVE s3://$BUCKET4/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION4
# aws s3 cp $ARCHIVE s3://$BUCKET2/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION2
# aws s3 cp $ARCHIVE s3://$BUCKET3/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION3
# aws s3 cp $ARCHIVE s3://$BUCKET4/$1/ $${@:3} --metadata type=$1,lines=$FILELINES,size=$SIZE --region $REGION4
rm $ARCHIVE
echo -e "Done.\n\n"

0 comments on commit 4cb938d

Please sign in to comment.