ci: push GIT_REF if it looks like a version

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-09-26 12:10:40 +02:00
parent 6072fcbee6
commit 184479e385
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 5 additions and 2 deletions

View File

@ -57,7 +57,7 @@ pipeline {
stage('Build') {
steps { script {
image = docker.build(
"${params.IMAGE_NAME}:${env.GIT_COMMIT.take(8)}",
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: env.GIT_COMMIT.take(8)}",
"--label=commit='${env.GIT_COMMIT.take(8)}' " +
"--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " +
"--build-arg=NIMFLAGS='${params.NIMFLAGS}' " +
@ -82,7 +82,10 @@ pipeline {
credentialsId: params.DOCKER_CRED, url: ""
]) {
image.push()
image.push(env.IMAGE_TAG)
/* If Git ref is a tag push it as Docker tag too. */
if (params.GIT_REF ==~ /v\d+\.\d+\.\d+.*/) {
image.push(params.GIT_REF)
}
}
} }
}