From eb1dadccb2bccdafbbb2259ced2c46bf07b79644 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Mon, 9 Dec 2019 17:43:29 -0700 Subject: [PATCH] build: always use the version suffix from tag pipeline The version suffix such as alpha.0, beta.0, or rc.0 only apply when running the tag pipeline or the release build. Otherwise, we don't want to use the suffix from the master build. Signed-off-by: Travis Nielsen --- Jenkinsfile | 4 ++-- build/release/Jenkinsfile.tag | 2 +- build/release/Makefile | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 76bcd965c..a7c9f56c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -146,8 +146,8 @@ pipeline { } steps { sh 'docker login -u="${DOCKER_USR}" -p="${DOCKER_PSW}"' - sh 'build/run make -j\$(nproc) -C build/release build BRANCH_NAME=${BRANCH_NAME} GIT_API_TOKEN=${GIT_PSW}' - sh 'build/run make -j\$(nproc) -C build/release publish BRANCH_NAME=${BRANCH_NAME} AWS_ACCESS_KEY_ID=${AWS_USR} AWS_SECRET_ACCESS_KEY=${AWS_PSW} GIT_API_TOKEN=${GIT_PSW}' + sh 'build/run make -j\$(nproc) -C build/release build BRANCH_NAME=${BRANCH_NAME} TAG_WITH_SUFFIX=true GIT_API_TOKEN=${GIT_PSW}' + sh 'build/run make -j\$(nproc) -C build/release publish BRANCH_NAME=${BRANCH_NAME} TAG_WITH_SUFFIX=true AWS_ACCESS_KEY_ID=${AWS_USR} AWS_SECRET_ACCESS_KEY=${AWS_PSW} GIT_API_TOKEN=${GIT_PSW}' } } } diff --git a/build/release/Jenkinsfile.tag b/build/release/Jenkinsfile.tag index 5ce5c5f34..09b28cfdd 100644 --- a/build/release/Jenkinsfile.tag +++ b/build/release/Jenkinsfile.tag @@ -21,7 +21,7 @@ pipeline { steps { // github credentials are not setup to push over https in jenkins. add the github token to the url sh "git config remote.origin.url https://${GITHUB_USR}:${GITHUB_PSW}@\$(git config --get remote.origin.url | sed -e 's/https:\\/\\///')" - sh "make -j\$(nproc) -C build/release tag VERSION=${params.version} COMMIT_HASH=${params.commit}" + sh "make -j\$(nproc) -C build/release tag VERSION=${params.version} COMMIT_HASH=${params.commit} TAG_WITH_SUFFIX=true" } } } diff --git a/build/release/Makefile b/build/release/Makefile index 0b2f321fc..309d7d51f 100644 --- a/build/release/Makefile +++ b/build/release/Makefile @@ -25,10 +25,9 @@ ifeq ($(filter master release,$(CHANNEL)),) $(error invalid channel $(CHANNEL)) endif -# When a release branch is first created, the tag shows up in the master branch build tags. -# When that tag has the alpha, beta, or rc suffixes, we want to remove it since it is only -# relevant to the release tags. -ifeq ($(CHANNEL),master) +# When running the tag pipeline or release build we always want to add the alpha, beta, or rc suffix +# if provided. Otherwise, it's a master build where we don't want to apply the suffix. +ifneq ($(TAG_WITH_SUFFIX),true) override VERSION := $(shell echo "$(VERSION)" | sed -e 's/-alpha.0//' -e 's/-beta.0//' -e 's/-rc.0//') endif