sourcegraph/enterprise/cmd/executor/release_binary.sh
Erik Seliger d2eefe7f6f
executors: Improve release process for binary (#42727)
This does a few changes:

Build binary and VM separately, it was a dirty hack that they ran in the same BK job
Upload the binary to a release directory for tagged releases
Adjust the docs to encourage people to use tagged releases instead of latest
I also manually uploaded the tagged releases for past releases back to 3.43.0
2022-10-11 21:41:44 +00:00

22 lines
917 B
Bash
Executable File

#!/usr/bin/env bash
# This script publishes the executor binary.
cd "$(dirname "${BASH_SOURCE[0]}")"/../../..
set -eu
# Copy uploaded binary to 'latest'.
# TODO: Revise this. latest should probably not exist at all.
if [ "${BUILDKITE_BRANCH}" = "main" ]; then
gsutil rm -rf gs://sourcegraph-artifacts/executor/latest || true
gsutil cp -r "gs://sourcegraph-artifacts/executor/$(git rev-parse HEAD)" gs://sourcegraph-artifacts/executor/latest
gsutil iam ch allUsers:objectViewer gs://sourcegraph-artifacts
fi
# If this is a tagged release, we want to create a directory for it.
if [ "${EXECUTOR_IS_TAGGED_RELEASE}" = "true" ]; then
gsutil rm -rf "gs://sourcegraph-artifacts/executor/${BUILDKITE_TAG}" || true
gsutil cp -r "gs://sourcegraph-artifacts/executor/$(git rev-parse HEAD)" "gs://sourcegraph-artifacts/executor/${BUILDKITE_TAG}"
gsutil iam ch allUsers:objectViewer gs://sourcegraph-artifacts
fi