-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
46 lines (41 loc) · 971 Bytes
/
.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
stages:
- test
- package
- release
.rules:
rules:
- if: $CI_COMMIT_TAG =~ "/^v[0-9]+[.][0-9]+[.][0-9]+$/"
test:
stage: test
image: dtzar/helm-kubectl
before_script:
- helm plugin install https://github.com/helm-unittest/helm-unittest.git
script:
- helm unittest chart/
rules:
- !reference [.rules, rules]
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == "main"
package:
stage: package
image: dtzar/helm-kubectl
extends: .rules
script:
- helm package chart
artifacts:
paths:
- generic-*.tgz
expire_in: "1 days"
release:
stage: release
image: curlimages/curl
extends: .rules
dependencies:
- package
script:
- package=$(ls generic-*.tgz)
- |
curl --request POST \
--user gitlab-ci-token:$CI_JOB_TOKEN \
--form "chart=@${package}" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"