-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
35 lines (31 loc) · 945 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
34
35
library 'jenkins-utils'
node("k8s") {
stage("Checkout") {
checkout scm
}
stage("Build") {
sh("make build")
}
stage("Release") {
sh("make release")
}
if (env.BRANCH_NAME.equals("master")) {
stage("Deploy") {
k8s_contexts = [
"staging",
"datastores-us-central1"
]
// getKubeconfig() is needed to get authentication to the k8s clusters
getKubeconfig()
// withRepoKey is needed in order to decrypt ecfg-encrypted secrets.
// If you don't have secrets, you don't need this. But it wont break
// anything to include it anyway.
withRepoKey {
k8s_contexts.each { cluster ->
template(cluster: cluster)
sh("kubectl --context ${cluster} apply -f ./tmp-k8s")
}
}
}
}
}