Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1214 from helium/simplify_buildkite_tags
Browse files Browse the repository at this point in the history
pass build trigger tag for image version
  • Loading branch information
madninja authored Nov 16, 2021
2 parents 5a0fff9 + c352684 commit bd48d87
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
14 changes: 10 additions & 4 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ steps:

- if: build.tag =~ /^validator/
name: ":debian: build validator deb"
env:
VERSION_TAG: $BUILDKITE_TAG
commands:
- "git fetch -t"
- ".buildkite/scripts/make_deb.sh"
Expand All @@ -22,6 +24,8 @@ steps:

- if: build.tag =~ /^validator/
name: ":cloud: upload validator deb to packagecloud"
env:
VERSION_TAG: $BUILDKITE_TAG
commands:
- "git fetch -t"
- ".buildkite/scripts/packagecloud_upload.sh"
Expand All @@ -32,10 +36,11 @@ steps:
- if: build.tag =~ /^validator/
name: "validator AMD64 docker"
env:
BUILD_TYPE: "validator"
IMAGE_ARCH: "amd64"
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "validator"
IMAGE_ARCH: "amd64"
BUILD_TYPE: "validator"
VERSION_TAG: $BUILDKITE_TAG
agents:
queue: "erlang"
commands:
Expand All @@ -45,10 +50,11 @@ steps:
- if: build.tag =~ /^validator/
name: "validator ARM64 docker"
env:
BUILD_TYPE: "validator"
IMAGE_ARCH: "arm64"
REGISTRY_HOST: "quay.io"
REGISTRY_NAME: "validator"
IMAGE_ARCH: "arm64"
BUILD_TYPE: "validator"
VERSION_TAG: $BUILDKITE_TAG
agents:
queue: "arm64"
commands:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/make_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

VERSION=$(git describe --abbrev=0 | sed -e 's,validator,,')
VERSION=$(echo $VERSION_TAG | sed -e 's,validator,,')
./rebar3 as validator release -n miner -v ${VERSION}

fpm -n validator \
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/make_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [[ "$IMAGE_ARCH" == "arm64" ]]; then
BASE_IMAGE="arm64v8/$BASE_IMAGE"
fi

VERSION=$(git describe --abbrev=0 | sed -e "s/$BUILD_TYPE//")
VERSION=$(echo $VERSION_TAG | sed -e "s/$BUILD_TYPE//")
DOCKER_BUILD_ARGS="--build-arg VERSION=$VERSION"

if [[ ! $TEST_BUILD -eq "0" ]]; then
Expand Down Expand Up @@ -61,7 +61,7 @@ if [[ ! $TEST_BUILD ]]; then
fi

# update latest tag if github tag ends in `_GA` and don't do the rest of a build
if [[ "$BUILDKITE_TAG" =~ _GA$ ]]; then
if [[ "$VERSION_TAG" =~ _GA$ ]]; then

echo "GA release detected: Updating latest tag on ${REGISTRY_HOST} for ${BUILD_TYPE}"

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/packagecloud_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

TAG=$( git describe --abbrev=0 --tags | sed -e s/validator// )
TAG=$(echo $VERSION_TAG | sed -e s/validator// )

PKGNAME="validator_${TAG}_amd64.deb"

Expand Down

0 comments on commit bd48d87

Please sign in to comment.