2017-07-21 18:37:14 +02:00
|
|
|
#!/bin/bash
|
2018-03-06 23:36:50 +01:00
|
|
|
# publish.sh builds and publishes the tarballs that our other repositories consume.
|
2018-09-03 18:49:57 +02:00
|
|
|
set -o nounset
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
2017-07-21 18:37:14 +02:00
|
|
|
|
2019-01-15 02:14:57 +01:00
|
|
|
# We run multiple legs on Linux, but only want to publish the tgz's from the one that publishes
|
|
|
|
# our NPM and PyPI packages. Otherwise, we may race with other legs when publishing to S3 which
|
|
|
|
# leads to issues about values being out of range.
|
|
|
|
if [ "${TRAVIS_OS_NAME:-}" = "linux" ] && [ "${TRAVIS_PUBLISH_PACKAGES:-}" != "true" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-09-03 18:49:57 +02:00
|
|
|
readonly ROOT=$(dirname "${0}")/..
|
|
|
|
readonly PUBLISH="${GOPATH}/src/github.com/pulumi/scripts/ci/publish.sh"
|
|
|
|
readonly PUBLISH_GOARCH=("amd64")
|
|
|
|
readonly PUBLISH_PROJECT="pulumi"
|
2017-09-22 04:10:33 +02:00
|
|
|
|
2018-09-03 18:49:57 +02:00
|
|
|
if [[ ! -f "${PUBLISH}" ]]; then
|
2017-09-07 20:07:52 +02:00
|
|
|
>&2 echo "error: Missing publish script at $PUBLISH"
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-07-21 18:37:14 +02:00
|
|
|
|
2018-09-03 18:49:57 +02:00
|
|
|
readonly OS=$(go env GOOS)
|
2017-09-26 02:00:08 +02:00
|
|
|
|
2018-02-12 22:13:13 +01:00
|
|
|
echo "Publishing SDK build to s3://eng.pulumi.com/:"
|
2018-09-03 18:49:57 +02:00
|
|
|
for ARCH in "${PUBLISH_GOARCH[@]}"; do
|
|
|
|
export GOARCH="${ARCH}"
|
|
|
|
RELEASE_INFO=($($(dirname "${0}")/make_release.sh))
|
|
|
|
"${PUBLISH}" ${RELEASE_INFO[0]} "${PUBLISH_PROJECT}/${OS}/${ARCH}" ${RELEASE_INFO[@]:1}
|
2017-09-22 04:10:33 +02:00
|
|
|
done
|
2018-09-03 18:49:57 +02:00
|
|
|
|
2019-01-15 02:14:57 +01:00
|
|
|
exit 0
|