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 {
stage('Build') {
steps {
sh '''
docker build \
-t ${REGISTRY}:${TAG} \
.
'''
script {
def tag = params.TAG ?: 'latest'
sh "docker build -t ${env.REGISTRY}:${tag} ."
}
}
}
stage('Push') {
steps {
sh '''
echo "${REGISTRY_CREDS_PSW}" | docker login atl.vultrcr.com -u "${REGISTRY_CREDS_USR}" --password-stdin
docker push ${REGISTRY}:${TAG}
'''
script {
def tag = params.TAG ?: 'latest'
sh """
echo '${env.REGISTRY_CREDS_PSW}' | docker login atl.vultrcr.com -u '${env.REGISTRY_CREDS_USR}' --password-stdin
docker push ${env.REGISTRY}:${tag}
"""
}
}
}
}