Fix empty TAG fallback in Jenkinsfile
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -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}
|
||||||
|
"""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user