Skip to content

Commit

Permalink
build(ci): download all required binary utilities during preparation
Browse files Browse the repository at this point in the history
Moves downloading all utilities in the prepare phase. This ensures that
if we fail to download it, it won't abort the pipeline after 20 minutes
of release, but instead fail early.
  • Loading branch information
npepinpe committed Dec 15, 2021
1 parent 6c9f919 commit 12229ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .ci/scripts/release/prepare-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
git config --global user.email "[email protected]"
git config --global user.name "${GITHUB_TOKEN_USR}"

GOCOMPAT_VERSION="v0.2.0"

curl -sL https://github.com/smola/gocompat/releases/download/${GOCOMPAT_VERSION}/gocompat_linux_amd64.tar.gz | tar xzvf - -C /usr/bin gocompat_linux_amd64
mv /usr/bin/gocompat_linux_amd64 /usr/bin/gocompat

# install binary tools; these are installed under $GOPATH/bin
# NOTE: this will not work on Go > 1.16 - instead we'll have to replace `go get -u` with
# `go install` (and possibly GO111MODULE=on is not required)
export CGO_ENABLED=0
export GO111MODULE=on
go get -u "github.com/smola/gocompat/[email protected]"
go get -u "github.com/go-bindata/go-bindata/...@v3"
14 changes: 10 additions & 4 deletions .ci/scripts/release/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

# remove origin and use GitHub App (reflected on filesystem and globally active)
git remote remove origin
git remote add origin https://${GITHUB_TOKEN_USR}:${GITHUB_TOKEN_PSW}@github.com/camunda-cloud/zeebe.git
git remote add origin "https://${GITHUB_TOKEN_USR}:${GITHUB_TOKEN_PSW}@github.com/camunda-cloud/zeebe.git"

# configure Jenkins GitHub user for Maven container
git config --global user.email "[email protected]"
git config --global user.name "${GITHUB_TOKEN_USR}"

# setup maven central gpg keys
gpg -q --allow-secret-key-import --import --no-tty --batch --yes ${GPG_SEC_KEY}
gpg -q --import --no-tty --batch --yes ${GPG_PUB_KEY}
rm ${GPG_SEC_KEY} ${GPG_PUB_KEY}
gpg -q --allow-secret-key-import --import --no-tty --batch --yes "${GPG_SEC_KEY}"
gpg -q --import --no-tty --batch --yes "${GPG_PUB_KEY}"
rm "${GPG_SEC_KEY}" "${GPG_PUB_KEY}"

# install binary tools; binary tools are installed outside of the repo to avoid dirtying it
BINDIR=${BINDIR:-/tmp}
curl -sL https://github.com/github-release/github-release/releases/download/v0.10.0/linux-amd64-github-release.bz2 | bzip2 -fd - > github-release
chmod +x github-release
mv github-release "${BINDIR}/github-release"

0 comments on commit 12229ea

Please sign in to comment.