-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
39 lines (39 loc) · 885 Bytes
/
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
pipeline {
agent any
environment {
WAR_BUILD_DEST = "build/libs/mdl-server.war"
WAR_DEPLOY_DEST = "$HOME/apps/tomcat8/apache-tomcat-8.5.11/webapps/"
}
stages {
stage('setup') {
steps {
sh 'cp $HOME/configs/config.environment.properties ./src/main/resources/'
sh 'cp $HOME/configs/config.secret.properties ./src/main/resources/'
sh 'cp $HOME/configs/logback-test.xml ./src/main/resources/'
sh 'cp $HOME/configs/tomcat.xml .'
}
}
stage('build') {
steps {
sh './gradlew assemble'
}
}
stage('test') {
steps {
sh './gradlew test'
}
}
stage('deploy') {
steps {
sh 'cp ${WAR_BUILD_DEST} ${WAR_DEPLOY_DEST}${BRANCH_NAME}.war'
}
}
}
post {
always {
junit '**/test-results/test/*.xml'
sh './gradlew clean'
archive '*.log'
}
}
}