File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed
Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change 11pipeline {
22 agent any
33 stages {
4- stage(' install ' ) {
4+ stage(' Build and Test ' ) {
55 steps {
66 withSonarQubeEnv(' SonarCloud' ) {
77 withMaven(maven : ' M3' ) {
8- sh " mvn clean install sonar:sonar -Dsonar.projectKey=vinscom_api-framework -Dsonar.organization=vinscom-github -Dsonar.branch.name=${ GIT_BRANCH} "
8+ sh " mvn clean package sonar:sonar -Dsonar.projectKey=vinscom_api-framework -Dsonar.organization=vinscom-github -Dsonar.branch.name=${ GIT_BRANCH} "
99 }
10+ junit ' target/surefire-reports/TEST-*.xml'
1011 }
1112 }
1213 }
13- stage(" Quality Gate" ) {
14+ stage(' Deploy Snapshot' ) {
15+ when {
16+ branch ' master'
17+ }
18+ steps {
19+ withMaven(maven : ' M3' ) {
20+ sh " mvn deploy -P pgp,release"
21+ }
22+ }
23+ }
24+ stage(' Deploy Release' ) {
25+ when {
26+ expression {
27+ env. TAG_NAME =~ / [0-9]+.[0-9]+.[0-9]+/
28+ }
29+ }
1430 steps {
15- junit ' **/target/surefire-reports/TEST-*.xml'
31+ withMaven(maven : ' M3' ) {
32+ sh " mvn versions:set -DnewVersion=${ TAG_NAME} "
33+ sh " mvn deploy -P pgp,release"
34+ sh " mvn nexus-staging:release -P pgp,release"
35+ }
1636 }
1737 }
1838 }
You can’t perform that action at this time.
0 commit comments