-
Notifications
You must be signed in to change notification settings - Fork 37
/
Jenkinsfile.orig
70 lines (69 loc) · 1.51 KB
/
Jenkinsfile.orig
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import java.text.SimpleDateFormat
pipeline {
options {
buildDiscarder logRotator(numToKeepStr: '5')
disableConcurrentBuilds()
}
agent {
kubernetes {
cloud "go-demo-5-build"
label "go-demo-5-build"
serviceAccount "build"
yamlFile "KubernetesPod.yaml"
}
}
environment {
image = "vfarcic/go-demo-5"
project = "go-demo-5"
domain = "acme.com"
cmAddr = "cm.acme.com"
}
stages {
stage("build") {
steps {
container("golang") {
script {
currentBuild.displayName = new SimpleDateFormat("yy.MM.dd").format(new Date()) + "-${env.BUILD_NUMBER}"
}
k8sBuildGolang("go-demo")
}
container("docker") {
k8sBuildImageBeta(image, false)
}
}
}
stage("func-test") {
steps {
container("helm") {
k8sUpgradeBeta(project, domain, "--set replicaCount=2 --set dbReplicaCount=1")
}
container("kubectl") {
k8sRolloutBeta(project)
}
container("golang") {
k8sFuncTestGolang(project, domain)
}
}
post {
always {
container("helm") {
k8sDeleteBeta(project)
}
}
}
}
stage("release") {
when {
branch "master"
}
steps {
container("docker") {
k8sPushImage(image, false)
}
container("helm") {
k8sPushHelm(project, "", cmAddr, true, true)
}
}
}
}
}