-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
47 lines (45 loc) · 1.16 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
pipeline {
agent any
stages {
stage('Check and Prepare') {
steps {
sh 'gradle clean'
sh 'rm -f src/main/resources/application.properties'
sh 'rm -f src/main/resources/static/props/base.properties'
sh 'cp /home/deploy-props/Blinck-Server/application.properties src/main/resources/application.properties'
sh 'cp /home/deploy-props/Blinck-Server/base.properties src/main/resources/static/props/base.properties'
sh 'gradle check -x build -x test --stacktrace'
}
}
stage('Test') {
steps {
sh 'gradle test --stacktrace'
}
}
stage('Build') {
steps {
sh 'gradle build -x test --stacktrace'
}
}
stage('Prepare artifacts') {
steps {
archiveArtifacts(artifacts: 'build/libs/*', onlyIfSuccessful: true)
}
}
stage('Clean') {
steps {
sh '(pkill -f gradle) || true'
}
}
}
post {
always {
sh '(pkill -f gradle) || true'
junit 'build/test-results/*.xml'
sh 'rm -f -r test-arch'
sh 'mkdir test-arch'
sh 'zip -r test-arch/test-report.zip build/reports'
archiveArtifacts 'test-arch/*.zip'
}
}
}