-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
74 lines (67 loc) · 1.54 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
image: quay.io/samsung_cnct/helm-registry-agent:v0.7.4-helm_2.6
variables:
CHART_REL: ${CI_COMMIT_SHA}
CHART_NAME: postgresql
REGISTRY_CHART_URI: ${REGISTRY_HOST}/${REGISTRY_CHART_ORG}/${CHART_NAME}
build-branch:
stage: build
only:
- branches
- master
artifacts:
paths:
- ./*/Chart.yaml
expire_in: 1 week
script:
- export BRANCH_TAG=`echo $CI_COMMIT_REF_NAME | sed 's/_/-/g'`
- CHART_VER=0.0.1-${BRANCH_TAG} envsubst < build/Chart.yaml.in > ${CHART_NAME}/Chart.yaml
test-branch:
stage: test
only:
- branches
- master
dependencies:
- build-branch
script:
- cat ${CHART_NAME}/Chart.yaml
- helm lint ${CHART_NAME}
deploy-branch:
stage: deploy
only:
- branches
- master
dependencies:
- build-branch
script:
- helm registry login -u ${REGISTRY_USERNAME} -p ${REGISTRY_PASSWORD} ${REGISTRY_HOST}
- cd ${CHART_NAME}
- helm registry push ${REGISTRY_CHART_URI} -c alpha
build-tags:
stage: build
only:
- tags
artifacts:
paths:
- ./*/Chart.yaml
expire_in: 1 week
script:
- CHART_VER=${CI_COMMIT_TAG} CHART_REL=0 envsubst < build/Chart.yaml.in > ${CHART_NAME}/Chart.yaml
test-tags:
stage: test
only:
- tags
dependencies:
- build-tags
script:
- cat ${CHART_NAME}/Chart.yaml
- helm lint ${CHART_NAME}
deploy-tags:
stage: deploy
only:
- tags
dependencies:
- build-tags
script:
- helm registry login -u ${REGISTRY_USERNAME} -p ${REGISTRY_PASSWORD} ${REGISTRY_HOST}
- cd ${CHART_NAME}
- helm registry push ${REGISTRY_CHART_URI} -c stable