|
|
@@ -18,16 +18,18 @@ node {
|
|
|
|
|
|
|
|
|
stage("Push images to nexus") {
|
|
|
- withCredentials([usernamePassword(credentialsId: 'nexus', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) {
|
|
|
- def nexusUrl = 'https://nexus.foodgame.fr'
|
|
|
- def nexusRepository = 'fatboar_repo'
|
|
|
-
|
|
|
- docker.withRegistry("${nexusUrl}", 'nexus') {
|
|
|
- // Push des images Docker vers le registre Nexus
|
|
|
- sh "docker push ${nexusUrl}/repository/${nexusRepository}/workflow_jenkins_1:latest"
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ docker.withRegistry('https://nexus.foodgame.fr', 'nexus') {
|
|
|
+ def dockerImageName = 'workflow_jenkins_1'
|
|
|
+ def dockerImageTag = 'latest'
|
|
|
+
|
|
|
+ // Étape de balisage de l'image Docker pour le registre Nexus
|
|
|
+ sh "docker tag ${dockerImageName}:${dockerImageTag} ${dockerImageName}:${dockerImageTag}"
|
|
|
+
|
|
|
+ // Étape de poussée de l'image Docker vers le registre Nexus
|
|
|
+ sh "docker push ${dockerImageName}:${dockerImageTag}"
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|