Skip to content

Commit 1f6c89b

Browse files
author
Siraj Rauff
committed
Adding Jenkinsfile
1 parent 493d972 commit 1f6c89b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Jenkinsfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
pipeline {
2+
agent any
3+
4+
environment {
5+
HAB_AUTH_TOKEN = credentials('hab-depot-token')
6+
HAB_BLDR_URL = "https://bldr.habitat.sh"
7+
}
8+
9+
stages {
10+
stage('download-keys') {
11+
steps {
12+
sh "hab origin key download ${env.HAB_ORIGIN} --auth ${HAB_AUTH_TOKEN} --url ${env.HAB_BLDR_URL}"
13+
sh "hab origin key download ${env.HAB_ORIGIN} --auth ${HAB_AUTH_TOKEN} --url ${env.HAB_BLDR_URL} --secret"
14+
}
15+
}
16+
stage('build') {
17+
steps {
18+
dir("${workspace}") {
19+
habitat task: 'build', directory: '.', origin: env.HAB_ORIGIN, authToken: env.HAB_AUTH_TOKEN, bldrUrl: env.HAB_BLDR_URL
20+
}
21+
}
22+
}
23+
stage('upload') {
24+
steps {
25+
habitat task: 'upload', lastBuildFile: "${workspace}/results/last_build.env", authToken: env.HAB_AUTH_TOKEN, bldrUrl: env.HAB_BLDR_URL
26+
}
27+
}
28+
stage('promote') {
29+
when { equals expected: 'master', actual: env.BRANCH_NAME }
30+
steps {
31+
habitat task: 'promote', channel: 'stage', lastBuildFile: "${workspace}/results/last_build.env", authToken: env.HAB_AUTH_TOKEN, bldrUrl: env.HAB_BLDR_URL
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)