-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
50 lines (47 loc) · 1.1 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
39
40
41
42
43
44
45
46
47
48
49
50
@Library('whiteblock-dev')_
import container.Image
String namespace = 'genesis-dev'
String releaseName = 'genesis-docs'
String defaultBranch = 'master'
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '30'))
}
environment {
IMAGE_TAG = "${env.GIT_COMMIT}"
}
stages {
stage('build') {
when { branch defaultBranch }
steps {
script {
image = new container.Image(
registry: 'gcr.io/infra-dev-249211',
name: 'docs',
tag: "${env.IMAGE_TAG}"
)
buildContainerImage(image)
}
}
}
stage('deploy') {
when { branch defaultBranch }
steps {
helm("""--tiller-namespace helm upgrade ${releaseName} chart/genesis-docs \
--install \
--namespace ${namespace} \
--set 'image.repository=${image.registry}/${image.name}' \
--set 'image.tag=${image.tag}' \
--wait"""
)
}
}
}
post {
always {
slackNotify(env.BRANCH_NAME == defaultBranch)
}
}
}