16
16
set -e
17
17
18
18
DRYRUN=true
19
+ PGP_PUBLISH=true
19
20
20
21
AWS_PROFILE=" "
21
22
STAGE_S3_BUCKET=" "
@@ -37,6 +38,7 @@ usage() {
37
38
echo " -s BUCKET AWS S3 Bucket for staging"
38
39
echo " -b BUCKET AWS S3 Bucket for publishing (default is ${PUBLISH_S3_BUCKET} )"
39
40
echo " -a ACL AWS S3 Object Canned ACL (default is public-read)"
41
+ echo " -c true|false Publish PGP Signatures (default is true)"
40
42
echo " -h Display this help message"
41
43
}
42
44
@@ -45,25 +47,36 @@ publish_s3() {
45
47
echo " Publishing as ecs-cli-linux-amd64-${tag} "
46
48
dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-linux-amd64-${tag} " " s3://${PUBLISH_S3_BUCKET} /ecs-cli-linux-amd64-${tag} "
47
49
dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-linux-amd64-${tag} .md5" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-linux-amd64-${tag} .md5"
48
- dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-linux-amd64-${tag} .asc" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-linux-amd64-${tag} .asc"
50
+ if ${PGP_PUBLISH} ; then
51
+ dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-linux-amd64-${tag} .asc" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-linux-amd64-${tag} .asc"
52
+ fi
49
53
echo " Publishing as ecs-cli-darwin-amd64-${tag} "
50
54
dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} " " s3://${PUBLISH_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} "
51
55
dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} .md5" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} .md5"
52
- dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} .asc" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} .asc"
56
+ if ${PGP_PUBLISH} ; then
57
+ dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} .asc" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-darwin-amd64-${tag} .asc"
58
+ fi
53
59
echo " Publishing as ecs-cli-windows-amd64-${tag} .exe"
54
60
dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .exe" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .exe"
55
61
dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .md5" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .md5"
56
- dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .exe.asc" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .exe.asc"
62
+ if ${PGP_PUBLISH} ; then
63
+ dexec s3_pull_push " s3://${STAGE_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .exe.asc" " s3://${PUBLISH_S3_BUCKET} /ecs-cli-windows-amd64-${tag} .exe.asc"
64
+ fi
57
65
done
58
66
}
59
67
60
- while getopts " :d:p:o:s:b:i:a:h" opt; do
68
+ while getopts " :d:p:o:s:b:i:a:h:c " opt; do
61
69
case ${opt} in
62
70
d)
63
71
if [[ " ${OPTARG} " = " false" ]]; then
64
72
DRYRUN=false
65
73
fi
66
74
;;
75
+ c)
76
+ if [[ " ${OPTARG} " = " false" ]]; then
77
+ PGP_PUBLISH=false
78
+ fi
79
+ ;;
67
80
p)
68
81
AWS_PROFILE=" ${OPTARG} "
69
82
;;
0 commit comments