Fix empty TAG fallback in Jenkinsfile

This commit is contained in:
2026-04-13 15:39:13 +00:00
parent 3293502548
commit 7d2f02a7cf

20
Jenkinsfile vendored
View File

@@ -13,20 +13,22 @@ pipeline {
stages { stages {
stage('Build') { stage('Build') {
steps { steps {
sh ''' script {
docker build \ def tag = params.TAG ?: 'latest'
-t ${REGISTRY}:${TAG} \ sh "docker build -t ${env.REGISTRY}:${tag} ."
. }
'''
} }
} }
stage('Push') { stage('Push') {
steps { steps {
sh ''' script {
echo "${REGISTRY_CREDS_PSW}" | docker login atl.vultrcr.com -u "${REGISTRY_CREDS_USR}" --password-stdin def tag = params.TAG ?: 'latest'
docker push ${REGISTRY}:${TAG} sh """
''' echo '${env.REGISTRY_CREDS_PSW}' | docker login atl.vultrcr.com -u '${env.REGISTRY_CREDS_USR}' --password-stdin
docker push ${env.REGISTRY}:${tag}
"""
}
} }
} }
} }