-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
52 lines (51 loc) · 1.63 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
pipeline {
agent none
stages {
stage('container') {
agent {
dockerfile {
args '-v ${HOME}/.m2:/home/builder/.m2 -v ${HOME}/bin:${HOME}/bin'
additionalBuildArgs '--build-arg BUILDER_UID=$(id -u)'
}
}
stages {
stage('clean') {
steps {
sh 'git reset --hard'
sh 'git clean -xffd'
}
}
stage('set_version_release') {
when { branch "master" }
steps {
withCredentials([usernamePassword(credentialsId: env.GIT_CREDENTIALS_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh './bumpversion.sh'
}
}
}
stage('build') {
steps {
sh 'mvn -B -DskipTests clean compile'
}
}
stage('test') {
steps {
sh 'mvn -B test'
}
}
stage('package') {
steps {
sh 'mvn -B -DskipTests package'
}
}
}
post {
success {
dir('src/main/target/') {
archiveArtifacts artifacts: '*.war', fingerprint: true, onlyIfSuccessful: true
}
}
}
}
}
}