Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit fde5bce

Browse files
committed
parameterize assset-profile and deploy-region
addresses #111
1 parent 26531fc commit fde5bce

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

_scripts/deploy.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mkdocs build
88
SITE_BUCKET=s3://docs.opendata.aws/genomics-workflows
99
ASSET_BUCKET=s3://aws-genomics-workflows
1010
ASSET_STAGE=test
11+
ASSET_PROFILE=asset-publisher
12+
DEPLOY_REGION=us-east-1
1113

1214
PARAMS=""
1315
while (( "$#" )); do
@@ -20,6 +22,14 @@ while (( "$#" )); do
2022
ASSET_BUCKET=$2
2123
shift 2
2224
;;
25+
--asset-profile)
26+
ASSET_PROFILE=$2
27+
shift 2
28+
;;
29+
--deploy-region)
30+
DEPLOY_REGION=$2
31+
shift 2
32+
;;
2333
--) # end optional argument parsing
2434
shift
2535
break
@@ -48,7 +58,7 @@ function s3_uri() {
4858
PREFIX_PARTS=(${PREFIX_PARTS[@]})
4959
PREFIX=$(printf '/%s' "${PREFIX_PARTS[@]%/}")
5060

51-
echo "${BUCKET%/}/${PREFIX:1}"
61+
echo "s3://${BUCKET%/}/${PREFIX:1}"
5262
}
5363

5464
function s3_sync() {
@@ -59,8 +69,8 @@ function s3_sync() {
5969
echo " from: $source"
6070
echo " to: $destination"
6171
aws s3 sync \
62-
--profile asset-publisher \
63-
--region us-east-1 \
72+
--profile $ASSET_PROFILE \
73+
--region $DEPLOY_REGION \
6474
--acl public-read \
6575
--delete \
6676
--metadata commit=$(git rev-parse HEAD) \
@@ -141,7 +151,7 @@ function templates() {
141151
function site() {
142152
echo "publishing site"
143153
aws s3 sync \
144-
--region us-east-1 \
154+
--region $DEPLOY_REGION \
145155
--acl public-read \
146156
--delete \
147157
--metadata commit=$(git rev-parse HEAD) \

0 commit comments

Comments
 (0)