forked from mschmidt712/kubernetes-ci-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.kr8ss
34 lines (23 loc) · 1.27 KB
/
Jenkinsfile.kr8ss
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
node {
checkout scm
env.DOCKER_API_VERSION="1.23"
sh "git rev-parse --short HEAD > commit-id"
tag = readFile('commit-id').replace("\n", "").replace("\r", "")
appName = "hello-kenzan"
registryHost = "127.0.0.1:30400/"
env.PUZZLE_IMG = "${registryHost}puzzle:${tag}"
env.KR8SS_IMG = "${registryHost}kr8sswordz:${tag}"
env.MONITOR_IMG = "${registryHost}monitor-scale:${tag}"
stage "Build"
sh "docker build -t ${env.PUZZLE_IMG} -f applications/puzzle/Dockerfile applications/puzzle"
sh "docker build -t ${env.KR8SS_IMG} -f applications/kr8sswordz-pages/Dockerfile applications/kr8sswordz-pages"
sh "docker build -t ${env.MONITOR_IMG} -f applications/monitor-scale/Dockerfile applications/monitor-scale"
stage "Push"
sh "docker push ${env.PUZZLE_IMG}"
sh "docker push ${env.KR8SS_IMG}"
sh "docker push ${env.MONITOR_IMG}"
stage "Deploy"
kubernetesDeploy configs: "applications/kr8sswordz-pages/k8s/deployment.yaml", kubeconfigId: 'kenzan_kubeconfig'
kubernetesDeploy configs: "applications/puzzle/k8s/deployment.yaml", kubeconfigId: 'kenzan_kubeconfig'
kubernetesDeploy configs: "applications/monitor-scale/k8s/deployment.yaml", kubeconfigId: 'kenzan_kubeconfig'
}