-
Notifications
You must be signed in to change notification settings - Fork 19
/
Jenkinsfile
35 lines (33 loc) · 1.26 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
pipeline {
agent any
environment {
HAB_AUTH_TOKEN = credentials('hab-depot-token')
HAB_BLDR_URL = "https://bldr.habitat.sh"
}
stages {
stage('download-keys') {
steps {
sh "hab origin key download ${env.HAB_ORIGIN} --auth ${HAB_AUTH_TOKEN} --url ${env.HAB_BLDR_URL}"
sh "hab origin key download ${env.HAB_ORIGIN} --auth ${HAB_AUTH_TOKEN} --url ${env.HAB_BLDR_URL} --secret"
}
}
stage('build') {
steps {
dir("${workspace}") {
habitat task: 'build', directory: '.', origin: env.HAB_ORIGIN, authToken: env.HAB_AUTH_TOKEN, bldrUrl: env.HAB_BLDR_URL
}
}
}
stage('upload') {
steps {
habitat task: 'upload', lastBuildFile: "${workspace}/results/last_build.env", authToken: env.HAB_AUTH_TOKEN, bldrUrl: env.HAB_BLDR_URL
}
}
stage('promote') {
when { equals expected: 'master', actual: env.BRANCH_NAME }
steps {
habitat task: 'promote', channel: 'stage', lastBuildFile: "${workspace}/results/last_build.env", authToken: env.HAB_AUTH_TOKEN, bldrUrl: env.HAB_BLDR_URL
}
}
}
}