Skip to content

Commit

Permalink
ci: use GIT_REF for building docker image when set
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Sep 11, 2024
1 parent bf2b7dc commit d64bb17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ci/Jenkinsfile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ pipeline {
stages {
stage('Build') {
steps { script {
def commitOrRef = params.GIT_REF ? params.GIT_REF.take(8) : GIT_COMMIT.take(8)
image = docker.build(
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: GIT_COMMIT.take(8)}",
"--build-arg='GIT_COMMIT=${GIT_COMMIT.take(8)}' ."
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: commitOrRef}",
"--build-arg='GIT_COMMIT=${commitOrRef}' ."
)
} }
}
Expand Down

0 comments on commit d64bb17

Please sign in to comment.