From ebfebd789d5005c42169ae1bf117d82a68123ff3 Mon Sep 17 00:00:00 2001 From: JustFiesta Date: Thu, 2 May 2024 15:23:11 +0200 Subject: [PATCH] Archive checkstyle --- Jenkinsfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7781f736e..4726067fa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,10 @@ +// Merge request pipeline pipeline { agent any environment { NEXUS_CREDS = credentials('nexus-cred') - NEXUS_DOCKER_REPO = '34.241.46.54:8085' + NEXUS_DOCKER_REPO_MR = '34.241.46.54:8085' + NEXUS_DOCKER_REPO_MAIN = '34.241.46.54:8084' } tools { @@ -15,6 +17,11 @@ pipeline { echo 'Running gradle checkstyle' sh './gradlew checkstyleMain --no-daemon' } + post { + always { + archiveArtifacts artifacts: 'build/reports/checkstyle/*.xml', fingerprint: true + } + } } stage('Test') { steps { @@ -32,7 +39,7 @@ pipeline { steps { echo 'Building docker Image' - sh 'docker build -t $NEXUS_DOCKER_REPO/spring-petclinic:${GIT_COMMIT} .' + sh 'docker build -t $NEXUS_DOCKER_REPO_MR/spring-petclinic:${GIT_COMMIT} .' } } stage('Docker Login') { @@ -40,7 +47,7 @@ pipeline { echo 'Nexus Docker Repository Login' script{ withCredentials([usernamePassword(credentialsId: 'nexus-cred', usernameVariable: 'USER', passwordVariable: 'PASS' )]){ - sh ' echo $PASS | docker login -u $USER --password-stdin $NEXUS_DOCKER_REPO' + sh 'echo $PASS | docker login -u $USER --password-stdin $NEXUS_DOCKER_REPO_MR' } } @@ -49,7 +56,7 @@ pipeline { stage('Docker Push') { steps { echo 'Pushing Image to docker hub' - sh 'docker push $NEXUS_DOCKER_REPO/spring-petclinic:${GIT_COMMIT}' + sh 'docker push $NEXUS_DOCKER_REPO_MR/spring-petclinic:${GIT_COMMIT}' } } }