-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
46 lines (43 loc) · 1.03 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
#!/usr/bin/env groovy
@Library('[email protected]') _
pipeline {
agent {
label 'helm'
}
environment {
dockerImage = null
PROJ_NAME = projName()
GIT_DESCRIPTION = gitDescribe()
DOCKER_IMG = dockerImageName("${LCO_DOCK_REG}", "${PROJ_NAME}", "${GIT_DESCRIPTION}")
}
options {
timeout(time: 1, unit: 'HOURS')
}
stages {
stage('Build image') {
steps {
script {
dockerImage = docker.build("${DOCKER_IMG}")
}
}
}
stage('Push image') {
steps {
script {
dockerImage.push()
}
}
}
stage('Deploy') {
when {
buildingTag();
}
steps {
withKubeConfig([credentialsId: 'prod-kube-config']) {
sh('helm --namespace prod upgrade --install floyds-ogg-en06 helm/ -f helm/ogg-values.yaml --force --set image.tag="${GIT_DESCRIPTION}"')
sh('helm --namespace prod upgrade --install floyds-coj-en12 helm/ -f helm/coj-values.yaml --force --set image.tag="${GIT_DESCRIPTION}"')
}
}
}
}
}