forked from rsandell/jhipster-sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
62 lines (62 loc) · 1.24 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
58
59
60
61
62
pipeline {
agent none
options {
skipDefaultCheckout()
}
stages {
stage('Checkout'){
agent any
steps {
checkout scm
stash(name: 'ws', includes: '**')
}
}
stage('Build Backend') {
agent {
docker {
image 'maven:3-alpine'
args '-v $HOME/.m2:/root/.m2'
}
}
steps {
unstash 'ws'
sh './mvnw -B -DskipTests=true clean compile package'
stash name: 'war', includes: 'target/**/*.war'
}
}
stage('Test Backend') {
agent {
docker {
image 'maven:3-alpine'
args '-v $HOME/.m2:/root/.m2'
}
}
steps {
unstash 'ws'
unstash 'war'
sh './mvnw -B test findbugs:findbugs'
}
post {
success {
junit '**/surefire-reports/**/*.xml'
findbugs pattern: 'target/**/findbugsXml.xml', unstableNewAll: '0'
}
}
}
stage('More Tests') {
steps {
sh 'echo \'Tests should be done!\''
}
}
stage('Deploy Staging') {
steps {
sh 'echo \'Deploying to Staging..\''
}
}
stage('Deploy Production') {
steps {
echo 'Deployiing to Production!'
}
}
}
}