Actualiser Jenkinsfile

This commit is contained in:
corenthin 2025-12-11 23:31:34 +01:00
parent cacba65fa2
commit b33d2a51d2

7
Jenkinsfile vendored
View File

@ -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}"