forked from federicobaldo/prometheus-rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
33 lines (26 loc) · 1008 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
#!/usr/bin/env groovy
folders = ["alertmanager", "graphite_exporter", "jmx_exporter", "jmx_javaagent_exporter", "node_exporter", "prometheus", "pushgateway"]
node() {
try {
stage 'Checkout Source'
checkout scm
withCredentials([[$class: 'UsernamePasswordBinding', credentialsId: "${env.DEPLOY_CREDENTIALS_ID}", variable: 'nexus_repository_credentials']]) {
withEnv(["WORKSPACE=${pwd()}",
"REPOSITORY_CREDENTIALS=${env.nexus_repository_credentials}"]) {
for (String folder : folders) {
dir(folder) {
stage "Build " + folder
sh "make rpm"
stage "Deploy " + folder
sh "make deploy"
}
}
}
}
} catch (err) {
println "Build failed due to an error!"
println err
//todo emit slack msg
currentBuild.result = "FAILURE"
}
}