-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
53 lines (49 loc) · 1.3 KB
/
.gitlab-ci.yml
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
include:
- template: Security/SAST.gitlab-ci.yml
variables:
SCAN_KUBERNETES_MANIFESTS: "true"
KUBESEC_HELM_CHARTS_PATH: "dumplings-helm-charts"
stages:
- test
- release
- deploy
##### upload new helm charts #####
release_charts:
stage: release
image: alpine/helm:3.2.1
only:
changes:
- dumplings-helm-charts/**/*
script:
- apk add curl
- CHART_VER=$(helm package ./dumplings-helm-charts | grep -o 'dumplings-helm-charts-.\+')
- echo "${CHART_VER}"
- curl -u ${NEXUS_UNAME}:${NEXUS_PASS} ${NEXUS_HELM_REPO} --upload-file ${CHART_VER}
##### deploy helm charts #####
deploy_helm:
stage: deploy
image: alpine/helm:3.11.1
when: manual
before_script:
- mkdir .kube/
- chmod 700 .kube/
- cp ${KUBECONFIG} .kube/config
- chmod 600 .kube/config
- cp ${CA_PEM} ca.pem
- chmod 600 ca.pem
script:
- helm repo add nexus ${NEXUS_HELM_REPO} --username ${NEXUS_UNAME} --password ${NEXUS_PASS}
- helm repo update
- >
helm upgrade dumplings nexus/dumplings-helm-charts
--install
--set environment=prod
--set fqdn="po-khmel.space"
--kube-ca-file ca.pem
--kubeconfig .kube/config
--namespace dumplings
--create-namespace
--atomic
--timeout 15m
after_script:
- rm -f .kube/config ca.pem