Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8dd11710
Commit
8dd11710
authored
Aug 03, 2015
by
Marek Grabowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12125 from justinsb/s3_use_queried_region
AWS: Query for location of S3 bucket, use that
parents
bff79366
230de787
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
util.sh
cluster/aws/util.sh
+7
-5
No files found.
cluster/aws/util.sh
View file @
8dd11710
...
...
@@ -487,7 +487,8 @@ function upload-server-tars() {
fi
echo
"Uploading to Amazon S3"
if
!
aws s3
ls
"s3://
${
AWS_S3_BUCKET
}
"
>
/dev/null 2>&1
;
then
if
!
aws s3api get-bucket-location
--bucket
${
AWS_S3_BUCKET
}
>
/dev/null 2>&1
;
then
echo
"Creating
${
AWS_S3_BUCKET
}
"
# Buckets must be globally uniquely named, so always create in a known region
...
...
@@ -497,7 +498,7 @@ function upload-server-tars() {
local
attempt
=
0
while
true
;
do
if
!
aws s3
ls
"s3://
${
AWS_S3_BUCKET
}
"
>
/dev/null 2>&1
;
then
if
!
aws s3
ls
--region
${
AWS_S3_REGION
}
"s3://
${
AWS_S3_BUCKET
}
"
>
/dev/null 2>&1
;
then
if
((
attempt
>
5
))
;
then
echo
echo
-e
"
${
color_red
}
Unable to confirm bucket creation."
>
&2
...
...
@@ -518,6 +519,7 @@ function upload-server-tars() {
if
[[
"
${
s3_bucket_location
}
"
==
"None"
]]
;
then
# "US Classic" does not follow the pattern
s3_url_base
=
https://s3.amazonaws.com
s3_bucket_location
=
us-east-1
fi
local
-r
staging_path
=
"devel"
...
...
@@ -530,13 +532,13 @@ function upload-server-tars() {
cp
-a
"
${
SERVER_BINARY_TAR
}
"
${
local_dir
}
cp
-a
"
${
SALT_TAR
}
"
${
local_dir
}
aws s3
sync
--exact-timestamps
${
local_dir
}
"s3://
${
AWS_S3_BUCKET
}
/
${
staging_path
}
/"
aws s3
sync
--
region
${
s3_bucket_location
}
--
exact-timestamps
${
local_dir
}
"s3://
${
AWS_S3_BUCKET
}
/
${
staging_path
}
/"
aws s3api put-object-acl
--bucket
${
AWS_S3_BUCKET
}
--key
"
${
server_binary_path
}
"
--grant-read
'uri="http://acs.amazonaws.com/groups/global/AllUsers"'
aws s3api put-object-acl
--
region
${
s3_bucket_location
}
--
bucket
${
AWS_S3_BUCKET
}
--key
"
${
server_binary_path
}
"
--grant-read
'uri="http://acs.amazonaws.com/groups/global/AllUsers"'
SERVER_BINARY_TAR_URL
=
"
${
s3_url_base
}
/
${
AWS_S3_BUCKET
}
/
${
server_binary_path
}
"
local
salt_tar_path
=
"
${
staging_path
}
/
${
SALT_TAR
##*/
}
"
aws s3api put-object-acl
--bucket
${
AWS_S3_BUCKET
}
--key
"
${
salt_tar_path
}
"
--grant-read
'uri="http://acs.amazonaws.com/groups/global/AllUsers"'
aws s3api put-object-acl
--
region
${
s3_bucket_location
}
--
bucket
${
AWS_S3_BUCKET
}
--key
"
${
salt_tar_path
}
"
--grant-read
'uri="http://acs.amazonaws.com/groups/global/AllUsers"'
SALT_TAR_URL
=
"
${
s3_url_base
}
/
${
AWS_S3_BUCKET
}
/
${
salt_tar_path
}
"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment