mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-04-23 13:13:07 +00:00
ci: use GIT_REF for building docker image when set
This commit is contained in:
parent
bf2b7dce1a
commit
d64bb172ef
@ -43,9 +43,10 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps { script {
|
steps { script {
|
||||||
|
def commitOrRef = params.GIT_REF ? params.GIT_REF.take(8) : GIT_COMMIT.take(8)
|
||||||
image = docker.build(
|
image = docker.build(
|
||||||
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: GIT_COMMIT.take(8)}",
|
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: commitOrRef}",
|
||||||
"--build-arg='GIT_COMMIT=${GIT_COMMIT.take(8)}' ."
|
"--build-arg='GIT_COMMIT=${commitOrRef}' ."
|
||||||
)
|
)
|
||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user