Actualiser Jenkinsfile
This commit is contained in:
parent
cacba65fa2
commit
b33d2a51d2
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@ -37,8 +37,11 @@ pipeline {
|
||||
stage('Push Docker Image') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'docker-registry-credentials', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME')]) {
|
||||
def registryHostPort = env.DOCKER_REGISTRY_URL.split('//')[1].split('/')[0]
|
||||
sh "echo \$DOCKER_PASSWORD | docker login -u \$DOCKER_USERNAME --password-stdin ${registryHostPort}"
|
||||
script {
|
||||
def registryHostPort = env.DOCKER_REGISTRY_URL.split('//')[1].split('/')[0]
|
||||
|
||||
sh "echo \$DOCKER_PASSWORD | docker login -u \$DOCKER_USERNAME --password-stdin ${registryHostPort}"
|
||||
}
|
||||
|
||||
sh "docker push ${env.IMAGE_TAG}"
|
||||
sh "docker rmi ${env.IMAGE_TAG}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user