forked from GIScience/openrouteservice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
58 lines (56 loc) · 1.66 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
pipeline {
agent any
environment {
GIT_COMMITTER_NAME = "jenkins"
GIT_COMMITTER_EMAIL = "[email protected]"
mvnHome = tool 'mvn-3.5'
}
stages {
stage("Preparation") {
when {
expression {
return env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'development';
}
}
steps {
deleteDir()
git branch: env.BRANCH_NAME, url: 'https://github.com/GIScience/openrouteservice.git'
}
}
stage("Build") {
when {
expression {
return env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'development';
}
}
steps {
sh "cp ${WORKSPACE}/openrouteservice-api-tests/conf/app.config.test ${WORKSPACE}/openrouteservice/WebContent/WEB-INF/app.config"
sh "'${mvnHome}/bin/mvn' -f ${WORKSPACE}/openrouteservice/pom.xml install -B"
archiveArtifacts artifacts: '**/*.war', fingerprint: true
}
}
stage("Test") {
when {
expression {
return env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'development';
}
}
steps {
sh "nohup '${mvnHome}/bin/mvn' -f ${WORKSPACE}/openrouteservice/pom.xml tomcat7:run & > ${WORKSPACE}/build_graphs.out&"
sh "sleep 5m"
sh "'${mvnHome}/bin/mvn' -f ${WORKSPACE}/openrouteservice-api-tests/pom.xml test"
}
}
}
post {
always {
deleteDir()
}
success {
rocketSend channel: 'ors-jenkins', message: "SUCCESS: ${currentBuild.fullDisplayName}", rawMessage: true
}
failure {
rocketSend channel: 'ors-jenkins', message: "FAILURE: ${currentBuild.fullDisplayName}", rawMessage: true
}
}
}