update maven exe in jenkinsfile

This commit is contained in:
imateja 2023-12-09 22:08:37 +01:00
parent bbe79bef70
commit 47e7a0eccd

10
Jenkinsfile vendored
View file

@ -3,7 +3,7 @@ pipeline {
stages { stages {
stage('Checkstyle') { stage('Checkstyle') {
steps { steps {
sh 'mvn checkstyle:checkstyle' sh './mvnw checkstyle:checkstyle'
} }
post { post {
always { always {
@ -13,20 +13,20 @@ pipeline {
} }
stage('Test') { stage('Test') {
steps { steps {
sh 'mvn test' sh './mvnw test'
} }
} }
stage('Build Without Tests') { stage('Build Without Tests') {
steps { steps {
sh 'mvn clean package -DskipTests' sh './mvnw clean package -DskipTests'
} }
} }
stage('Create Docker Image and Push') { stage('Create Docker Image and Push') {
steps { steps {
script { script {
def commitId = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() def commitId = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
sh "docker build -t your-docker-hub-username/spring-petclinic:${commitId} ." sh "docker build -t mivancevic/spring-petclinic:${commitId} ."
sh "docker push your-docker-hub-username/spring-petclinic:${commitId}" sh "docker push mivancevic/spring-petclinic:${commitId}"
} }
} }
} }