forked from nais/naisible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
38 lines (28 loc) · 1.15 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
node {
def committer, committerEmail, changelog // metadata
try {
stage("init") {
git url: "https://github.com/nais/naisible.git"
dir("nais-inventory"){
git url: "ssh://git@stash.devillo.no:7999/aura/nais-inventory.git"
}
committer = sh(script: 'git log -1 --pretty=format:"%ae (%an)"', returnStdout: true).trim()
committerEmail = sh(script: 'git log -1 --pretty=format:"%ae"', returnStdout: true).trim()
}
stage("teardown") {
sh('ansible-playbook -i ./nais-inventory/nais-ci teardown-playbook.yaml')
}
stage("setup") {
sh('ansible-playbook -i ./nais-inventory/nais-ci setup-playbook.yaml')
}
stage("test") {
sleep 15 // allow addons to start
sh('ansible-playbook -i ./nais-inventory/nais-ci test-playbook.yaml')
}
} catch(e) {
currentBuild.result = "FAILED"
throw e
mail body: message, from: "jenkins@aura.adeo.no", subject: "FAILED to complete ${env.JOB_NAME}", to: committerEmail
def errormessage = "see jenkins for more info ${env.BUILD_URL}"
}
}