Skip to content

Commit 76067ff

Browse files
committed
Make publishing PGP Signatures Optional
1 parent 1a36137 commit 76067ff

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

scripts/publish-staged

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
set -e
1717

1818
DRYRUN=true
19+
PGP_PUBLISH=true
1920

2021
AWS_PROFILE=""
2122
STAGE_S3_BUCKET=""
@@ -37,6 +38,7 @@ usage() {
3738
echo " -s BUCKET AWS S3 Bucket for staging"
3839
echo " -b BUCKET AWS S3 Bucket for publishing (default is ${PUBLISH_S3_BUCKET})"
3940
echo " -a ACL AWS S3 Object Canned ACL (default is public-read)"
41+
echo " -c true|false Publish PGP Signatures (default is true)"
4042
echo " -h Display this help message"
4143
}
4244

@@ -45,25 +47,36 @@ publish_s3() {
4547
echo "Publishing as ecs-cli-linux-amd64-${tag}"
4648
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-linux-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-linux-amd64-${tag}"
4749
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
4953
echo "Publishing as ecs-cli-darwin-amd64-${tag}"
5054
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}"
5155
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
5359
echo "Publishing as ecs-cli-windows-amd64-${tag}.exe"
5460
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.exe" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.exe"
5561
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
5765
done
5866
}
5967

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
6169
case ${opt} in
6270
d)
6371
if [[ "${OPTARG}" = "false" ]]; then
6472
DRYRUN=false
6573
fi
6674
;;
75+
c)
76+
if [[ "${OPTARG}" = "false" ]]; then
77+
PGP_PUBLISH=false
78+
fi
79+
;;
6780
p)
6881
AWS_PROFILE="${OPTARG}"
6982
;;

0 commit comments

Comments
 (0)