mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
ci: enforce default Docker image tags strictly
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
56feedc58a
commit
6072fcbee6
@ -19,7 +19,7 @@ pipeline {
|
|||||||
string(
|
string(
|
||||||
name: 'IMAGE_TAG',
|
name: 'IMAGE_TAG',
|
||||||
description: 'Name of Docker tag to push. Optional Parameter.',
|
description: 'Name of Docker tag to push. Optional Parameter.',
|
||||||
defaultValue: params.IMAGE_TAG ?: 'deploy-wakuv2-test',
|
defaultValue: getDefaultImageTag()
|
||||||
)
|
)
|
||||||
string(
|
string(
|
||||||
name: 'IMAGE_NAME',
|
name: 'IMAGE_NAME',
|
||||||
@ -76,6 +76,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Push') {
|
stage('Push') {
|
||||||
|
when { expression { params.IMAGE_TAG != '' } }
|
||||||
steps { script {
|
steps { script {
|
||||||
withDockerRegistry([
|
withDockerRegistry([
|
||||||
credentialsId: params.DOCKER_CRED, url: ""
|
credentialsId: params.DOCKER_CRED, url: ""
|
||||||
@ -86,6 +87,7 @@ pipeline {
|
|||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
} // stages
|
} // stages
|
||||||
|
|
||||||
post {
|
post {
|
||||||
success { script {
|
success { script {
|
||||||
def discord = load 'ci/discord.groovy'
|
def discord = load 'ci/discord.groovy'
|
||||||
@ -97,3 +99,14 @@ pipeline {
|
|||||||
always { sh 'docker image prune -f' }
|
always { sh 'docker image prune -f' }
|
||||||
} // post
|
} // post
|
||||||
} // pipeline
|
} // pipeline
|
||||||
|
|
||||||
|
def getDefaultImageTag() {
|
||||||
|
if (env.JOB_BASE_NAME) {
|
||||||
|
return env.JOB_BASE_NAME
|
||||||
|
}
|
||||||
|
switch (env.JOB_BASE_NAME) {
|
||||||
|
case 'docker-latest': return 'latest'
|
||||||
|
case 'docker-release': return 'stable'
|
||||||
|
default: return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user