From 0368d9003c29e8ef7dc25149215eab382616f0eb Mon Sep 17 00:00:00 2001 From: work Date: Wed, 5 Feb 2025 19:09:25 +0100 Subject: [PATCH] asda --- Jenkinsfile | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ae893d51..e7193c7e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,8 +7,9 @@ pipeline { imageName = "spring-pet-clinic" registryCredentials = "nexus-credentials" - registry = "https://localhost:9081" + registry = "localhost:9081" dockerImage = '' + DOCKERHUB_CREDENTIALS="piachsecki-dockerhub" } tools { @@ -16,15 +17,30 @@ pipeline { } stages { + + stage ('Docker build') { steps { script { - sh '/usr/sbin/envShell.sh build -t spring-pet-clinic .' + sh '/usr/sbin/envShell.sh build -t piachsecki/spring-pet-clinic:latest .' } } } + stage('Login to dockerhub') { + steps { + sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' + } + } + stage('Push') { + steps { + sh 'docker push piachsecki/spring-pet-clinic:latest' + } + + } + + /*stage ('Build') { steps { sh './mvnw -B -DskipTests clean package'