-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
68 lines (57 loc) · 1.39 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
63
64
65
66
67
68
pipeline {
agent any
stages {
stage('Clean') {
steps {
sh 'gradle clean -b pipeline-demo/build.gradle'
}
}
stage('Bulild') {
steps {
withGradle() {
sh 'gradle build -b pipeline-demo/build.gradle'
}
}
}
stage('Test') {
parallel {
stage('Unit Tests') {
steps {
sh 'gradle test -b pipeline-demo/build.gradle'
}
}
stage('Code Quality') {
environment {
sonarUrl = 'http://localhost:9000'
sonarToken = '0c0b3b61dddfd26b0b88d90aef908318951538fd'
}
steps {
sh 'gradle sonarqube -b pipeline-demo/build.gradle -DsonarUrl=${sonarUrl} -DsonarToken=${sonarToken}'
}
}
stage('Coverage') {
steps {
sh 'gradle jacocoTestReport -b pipeline-demo/build.gradle'
}
}
}
}
stage('Promotion') {
steps {
timeout(time: 1, unit: 'DAYS') {
input 'Deploy to Production?'
}
}
}
stage('Migration') {
steps {
sh 'gradle flywayMigrate -b pipeline-demo/build.gradle -Pflyway.url=jdbc:postgresql://localhost:32768/ -Pflyway.user=postgres -Pflyway.password=postgres'
}
}
stage('Deploy') {
steps {
sh 'gradle deployHeroku -b pipeline-demo/build.gradle'
}
}
}
}