-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile
55 lines (54 loc) · 1.72 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
// This jenkins pipeline config file allows isaac to be built in jenkins, assuming your jenkins installation
// contains the necessary plugins.
// The suggested set of plugins to utilize this file is:
//
// git:3.9.1
// git-client:2.7.3
// workflow-aggregator:2.5
// pipeline-maven:3.5.11
// maven-plugin:3.1.2
// durable-task:1.25
// tasks:4.52
// junit-attachments:1.5
// ws-cleanup:0.34
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5'))
}
environment {
MVN_TASK = "${DEPLOY ?: "install"}"
}
tools {
// Maven installation declared in the Jenkins "Global Tool Configuration"
maven 'M3'
}
stages {
stage('Build') {
//with a gitflow pattern, we can't build master multiple times, as you can't overwrite non-snapshot builds on nexus.
when {
not {
branch 'master'
}
}
steps {
//by default, this runs mvn clean install. If you want it to deploy, DEPLOY should be specified in jenkins -> configure system -> env variables
//Set it to something like 'deploy -DaltDeploymentRepository=snapshotRepo::default::http://52.61.165.55:9092/nexus/content/repositories/snapshots/'
sh "mvn clean $MVN_TASK"
openTasks high: 'FIXME', normal: 'TODO', pattern: '**/*.java'
}
}
}
post {
always {
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml'
cleanWs()
}
//failure {
// slackSend(color: '#FF0000', message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}")
//}
//fixed {
// slackSend(color: '#00FF00', message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}")
//}
}
}