Skip to content

Commit 3d146b7

Browse files
committed
Update build
1 parent 421d95a commit 3d146b7

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

Jenkinsfile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
pipeline {
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
}

0 commit comments

Comments
 (0)