Skip to content

Commit 8c994ec

Browse files
authored
Fixing bug in publishing scripts. (aws#300)
1 parent 2b62bac commit 8c994ec

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎scripts/publish-functions.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ check_md5() {
4040
}
4141

4242
s3_cp() {
43+
profile=""
44+
if [[ ! -z "${AWS_PROFILE}" ]]; then
45+
profile="--profile=${AWS_PROFILE}"
46+
fi
47+
acl="public-read"
48+
if [[ ! -z "${S3_ACL_OVERRIDE}" ]]; then
49+
acl="${S3_ACL_OVERRIDE}"
50+
fi
51+
echo "Copying ${1} to ${2}"
52+
aws ${profile} s3 cp "${1}" "${2}" "--acl=${acl}"
53+
}
54+
55+
s3_pull_push() {
4356
profile=""
4457
if [[ ! -z "${AWS_PROFILE}" ]]; then
4558
profile="--profile=${AWS_PROFILE}"

‎scripts/publish-staged‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ usage() {
4343
publish_s3() {
4444
for tag in ${ARTIFACT_TAG_VERSION} ${ARTIFACT_TAG_SHA} ${ARTIFACT_TAG_LATEST}; do
4545
echo "Publishing as ecs-cli-linux-amd64-${tag}"
46-
dexec s3_cp "s3://${STAGE_S3_BUCKET}/ecs-cli-linux-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-linux-amd64-${tag}"
47-
dexec s3_cp "s3://${STAGE_S3_BUCKET}/ecs-cli-linux-amd64-${tag}.md5" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-linux-amd64-${tag}.md5"
46+
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-linux-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-linux-amd64-${tag}"
47+
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-linux-amd64-${tag}.md5" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-linux-amd64-${tag}.md5"
4848
echo "Publishing as ecs-cli-darwin-amd64-${tag}"
49-
dexec s3_cp "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}"
50-
dexec s3_cp "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}.md5" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}.md5"
49+
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}"
50+
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}.md5" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}.md5"
5151
done
5252
}
5353

0 commit comments

Comments
 (0)