-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-deploy-snapshot
53 lines (44 loc) · 1.27 KB
/
Jenkinsfile-deploy-snapshot
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
#!groovy
stage ('Approve deploy?') {
timeout(time: 5, unit: 'MINUTES') {
input message: 'Deploy snapshot?'
}
}
// one at a time!
lock('lock-deploy-snapshot') {
stage('Deploy snapshot') {
node {
timeout(time: 5, unit: 'MINUTES') {
checkout scm
stash excludes: 'build/', includes: '**', name: 'source'
sh './gradlew deployToTest -PrepoId=snapshots -PartifactVersion=' + version()
}
}
}
}
stage ('Health check') {
timeout(time: 5, unit: 'MINUTES') {
parallel 'testServer1': {
node {
retry(5) {
unstash 'source'
sh 'chmod 755 gradlew'
sh 'SPRING_PROFILES_ACTIVE=online,test,testServer1 ./gradlew smokeTest'
}
}
}, 'testServer2': {
node {
retry(5) {
unstash 'source'
sh 'chmod 755 gradlew'
sh 'SPRING_PROFILES_ACTIVE=online,test,testServer2 ./gradlew smokeTest'
}
}
}
deleteDir() // Wipe out the workspace
}
}
def version() {
def props = readProperties file: 'gradle.properties'
return props['version']
}