Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
Add batch option for maven command
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNiang committed Apr 23, 2021
1 parent 1759f61 commit bda26a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile-on-prem
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ pipeline {
stage ('unit test') {
steps {
container ('maven') {
sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test'
sh 'mvn -B -o -gs `pwd`/configuration/settings.xml clean test'
}
}
}

stage ('build & push') {
steps {
container ('maven') {
sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
sh 'mvn -B -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
sh 'docker build -f Dockerfile-on-prem -t $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$HARBOR_CREDENTIAL_ID" ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile-online
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ pipeline {
stage ('unit test') {
steps {
container ('maven') {
sh 'mvn clean -gs `pwd`/configuration/settings.xml test'
sh 'mvn -B -gs `pwd`/configuration/settings.xml clean test'
}
}
}

stage ('build & push') {
steps {
container ('maven') {
sh 'mvn -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
sh 'mvn -B -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
Expand Down

0 comments on commit bda26a9

Please sign in to comment.