forked from Netflix/Priam
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
49 lines (43 loc) · 1.2 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
#!/usr/bin/env groovy
pipeline {
agent {
label 'java/11-docker-ecr && environment/qa && account/bv-nexus-qa'
}
options {
timeout(time: 20, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '20'))
disableConcurrentBuilds()
timestamps()
}
tools {
maven 'maven-3.6.3'
}
stages {
stage('Build') {
steps {
sh '''mvn -e verify -Ddependency-check.skip=true -Pdocker'''
}
}
}
post {
success {
script {
setBuildStatus("Build succeeded", "SUCCESS")
}
}
unsuccessful {
script {
setBuildStatus("Build failed", "FAILED")
}
}
}
}
def void setBuildStatus(String message, String state) {
step([
$class : "GitHubCommitStatusSetter",
reposSource : [$class: "ManuallyEnteredRepositorySource", url: '[email protected]:bazaarvoice/Priam.git'],
contextSource : [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers : [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]]
])
}