Merge pull request #6090 from justinsb/use_s3_bucket_location

Use the correct region for the S3 bucket
This commit is contained in:
Victor Marmol 2015-03-30 09:40:42 -07:00
commit a4daa88fdc

View File

@ -236,8 +236,9 @@ function upload-server-tars() {
aws s3 mb "s3://${AWS_S3_BUCKET}" --region ${AWS_S3_REGION}
fi
local s3_url_base=https://s3-${AWS_S3_REGION}.amazonaws.com
if [[ "${AWS_S3_REGION}" == "us-east-1" ]]; then
local s3_bucket_location=$(aws --output text s3api get-bucket-location --bucket ${AWS_S3_BUCKET})
local s3_url_base=https://s3-${s3_bucket_location}.amazonaws.com
if [[ "${s3_bucket_location}" == "us-east-1" ]]; then
# us-east-1 does not follow the pattern
s3_url_base=https://s3.amazonaws.com
fi