From 2c08ff1299a61593b01693d802f2ef5225fef8dd Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Wed, 11 Nov 2020 17:11:48 +0100 Subject: [PATCH] build: push git commit hash as tags as well (#16261) --- build/Jenkinsfile.branch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/Jenkinsfile.branch b/build/Jenkinsfile.branch index 903e4b858b..88b8cba34b 100644 --- a/build/Jenkinsfile.branch +++ b/build/Jenkinsfile.branch @@ -128,14 +128,16 @@ pipeline { withCredentials([usernamePassword(credentialsId: 'matterbuild-docker-hub', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) { sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}' sh """ + export GIT_COMMIT=$(git rev-parse --short HEAD) export TAG='${env.BRANCH_NAME}' - docker build --no-cache --build-arg MM_PACKAGE=https://releases.mattermost.com/mattermost-platform/${env.BRANCH_NAME}/mattermost-enterprise-linux-amd64.tar.gz -t mattermost/mattermost-enterprise-edition:\${TAG} build - docker push mattermost/mattermost-enterprise-edition:\${TAG} + docker build --no-cache --build-arg MM_PACKAGE=https://releases.mattermost.com/mattermost-platform/${env.BRANCH_NAME}/mattermost-enterprise-linux-amd64.tar.gz -t mattermost/mattermost-enterprise-edition:\${TAG} -t mattermost/mattermost-enterprise-edition:\${GIT_COMMIT} build + docker push mattermost/mattermost-enterprise-edition:\${TAG} mattermost/mattermost-enterprise-edition:\${GIT_COMMIT} """ sh """ + export GIT_COMMIT=$(git rev-parse --short HEAD) export TAG='${env.BRANCH_NAME}' - docker build --no-cache --build-arg MM_PACKAGE=https://releases.mattermost.com/mattermost-platform/${env.BRANCH_NAME}/mattermost-team-linux-amd64.tar.gz -t mattermost/mattermost-team-edition:\${TAG} build - docker push mattermost/mattermost-team-edition:\${TAG} + docker build --no-cache --build-arg MM_PACKAGE=https://releases.mattermost.com/mattermost-platform/${env.BRANCH_NAME}/mattermost-team-linux-amd64.tar.gz -t mattermost/mattermost-team-edition:\${TAG} -t mattermost/mattermost-team-edition:\${GIT_COMMIT} build + docker push mattermost/mattermost-team-edition:\${TAG} mattermost/mattermost-team-edition:\${GIT_COMMIT} docker logout """ }