This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pipeline.yaml
119 lines (112 loc) · 3.21 KB
/
pipeline.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
pipeline:
create_cluster:
image: banzaicloud/ci-pipeline-client:0.12
action: EnsureCluster
test:
image: node:10-slim
commands:
- npm ci
- npm test
build_image:
image: banzaicloud/kaniko-plugin
dockerfile: Dockerfile
repo: '{{ .CICD_REPO }}'
tags: '{{ trunc 7 .CICD_COMMIT_SHA }}'
secretFrom:
DOCKER_USERNAME:
# name:
keyRef: username
DOCKER_PASSWORD:
# name:
keyRef: password
package_application:
when:
branch:
include: [master]
image: lachlanevenson/k8s-helm:v2.16.1
commands:
- helm init -c
- helm repo add stable https://kubernetes-charts.storage.googleapis.com
- helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
- helm package ./.banzaicloud/charts/spotguide-nodejs-mongodb
install_mongodb_user_secret:
when:
branch:
include: [master]
image: banzaicloud/ci-pipeline-client:0.12
action: InstallSecret
clusterSecret:
# sourceSecretName:
name: '{{ .CICD_REPO_NAME }}-mongodb'
namespace: default
merge: true
spec:
- name: mongodb-username
source: username
- name: mongodb-password
source: password
install_mongodb_root_secret:
when:
branch:
include: [master]
image: banzaicloud/ci-pipeline-client:0.12
action: InstallSecret
clusterSecret:
# sourceSecretName:
name: '{{ .CICD_REPO_NAME }}-mongodb'
namespace: default
merge: true
spec:
- name: mongodb-root-password
source: password
install_mongodb_replica_set_key_secret:
when:
branch:
include: [master]
image: banzaicloud/ci-pipeline-client:0.12
action: InstallSecret
clusterSecret:
# sourceSecretName:
name: '{{ .CICD_REPO_NAME }}-mongodb'
namespace: default
merge: true
spec:
- name: mongodb-replica-set-key
source: password
deploy_application:
when:
branch:
include: [master]
image: banzaicloud/ci-pipeline-client:0.12
action: EnsureDeployment
deployment:
name: './spotguide-nodejs-mongodb-1.0.0.tgz'
namespace: default
reuseValues: true
releaseName: '{{ .CICD_REPO_NAME }}'
wait: true
timeout: 900
values:
deployment:
image:
repository: '{{ .CICD_REPO }}'
tag: '{{ trunc 7 .CICD_COMMIT_SHA }}'
pullPolicy: Always
ingress:
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/redirect-regex: ^http://(.*)
traefik.ingress.kubernetes.io/redirect-replacement: https://$1
traefik.ingress.kubernetes.io/redirect-permanent: "true"
hosts:
{{{{- if .platform.AutoDNSEnabled }}}}
- '{{ lower (printf "app-%s-%s.%s.%s" .CICD_REPO_NAME (.CLUSTER_NAME | sha1sum | trunc 10) .ORG_NAME .DOMAIN_NAME) }}'
{{{{- else }}}}
- '/'
{{{{- end }}}}
mongodb:
metrics:
enabled: true
usePassword: true
existingSecret: '{{ .CICD_REPO_NAME }}-mongodb'
# mongodbDatabase: