Skip to content

Commit

Permalink
[Bugfix] Update staging script so that Windows binaries have a .exe f…
Browse files Browse the repository at this point in the history
…ile extension in the staging bucket.
  • Loading branch information
PettitWesley authored and SoManyHs committed Nov 29, 2017
1 parent 28cf8fd commit e36a7d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/publish-staged
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ publish_s3() {
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}"
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}.md5" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-darwin-amd64-${tag}.md5"
echo "Publishing as ecs-cli-windows-amd64-${tag}.exe"
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-windows-amd64-${tag}" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.exe"
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.exe" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.exe"
dexec s3_pull_push "s3://${STAGE_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.md5" "s3://${PUBLISH_S3_BUCKET}/ecs-cli-windows-amd64-${tag}.md5"
done
}
Expand Down
17 changes: 11 additions & 6 deletions scripts/stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,27 @@ if ! ${ALLOW_DIRTY}; then
fi

make docker-build
mv bin/windows-amd64/ecs-cli.exe bin/windows-amd64/ecs-cli

for platform in "linux-amd64" "darwin-amd64" "windows-amd64"; do
artifact="bin/${platform}/ecs-cli"
publish_binary() {
platform=$1
extension=$2
artifact="bin/${platform}/ecs-cli${extension}"
artifact_md5="$(mktemp)"
md5sum "${artifact}" | sed 's/ .*//' > "${artifact_md5}"

for tag in ${ARTIFACT_TAG_VERSION} ${ARTIFACT_TAG_SHA} ${ARTIFACT_TAG_LATEST}; do
key_name="ecs-cli-${platform}-${tag}"
key_name="ecs-cli-${platform}-${tag}${extension}"
echo "Publishing as ${key_name} with md5sum $(cat ${artifact_md5})"
dexec s3_cp "${artifact}" "s3://${S3_BUCKET}/${key_name}"
dexec s3_cp "${artifact_md5}" "s3://${S3_BUCKET}/${key_name}.md5"
dexec s3_cp "${artifact_md5}" "s3://${S3_BUCKET}/ecs-cli-${platform}-${tag}.md5"
done

rm "${artifact_md5}"
done
}

publish_binary "linux-amd64" ""
publish_binary "darwin-amd64" ""
publish_binary "windows-amd64" ".exe"

cd "${CWD}"

Expand Down

0 comments on commit e36a7d1

Please sign in to comment.