-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
39 lines (39 loc) · 953 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pipeline {
agent any
stages {
stage('Build and Test') {
steps {
withSonarQubeEnv('SonarCloud') {
withMaven(maven: 'M3') {
sh "mvn clean package sonar:sonar -Dsonar.projectKey=vinscom_glue -Dsonar.organization=vinscom-github -Dsonar.branch.name=${GIT_BRANCH}"
}
junit 'target/surefire-reports/TEST-*.xml'
}
}
}
stage('Deploy Snapshot') {
when {
branch 'master'
}
steps {
withMaven(maven: 'M3') {
sh "mvn deploy -P pgp,release"
}
}
}
stage('Deploy Release') {
when {
expression {
env.TAG_NAME =~ /[0-9]+.[0-9]+.[0-9]+/
}
}
steps {
withMaven(maven: 'M3') {
sh "mvn versions:set -DnewVersion=${TAG_NAME}"
sh "mvn deploy -P pgp,release"
sh "mvn nexus-staging:release -P pgp,release"
}
}
}
}
}