-
Notifications
You must be signed in to change notification settings - Fork 113
/
Jenkinsfile
57 lines (57 loc) · 1.44 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
53
54
55
56
57
pipeline {
agent {
docker {
image 'junkdog/mvn-3-jdk8'
// -u root for /root/.m2 to be resolved
args '-v /root/.m2:/root/.m2 -u root'
}
}
options {
skipStagesAfterUnstable()
}
triggers {
// nightly deploy job
cron('H H * * *')
}
stages {
stage ('Initialize') {
steps {
sh "echo `whoami`"
echo "USER = ${env.USER}"
echo "HOME = ${env.HOME}"
echo "PATH = ${env.PATH}"
echo "M2_HOME = ${env.M2_HOME}"
}
}
stage ('Build and Test') {
steps {
sh 'mvn integration-test -Pgwttest -B'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
archiveArtifacts allowEmptyArchive: true, artifacts: '*/target/*.jar'
}
}
}
stage('Install') {
when {
not { triggeredBy "TimerTrigger" }
}
steps {
sh 'mvn install -DskipTests -B'
}
}
stage('Deploy') {
when {
allOf {
branch 'develop'
triggeredBy 'TimerTrigger'
}
}
steps {
sh 'mvn deploy -DskipTests -B'
}
}
}
}