-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
71 lines (65 loc) · 1.79 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
---
variables:
HELM_VERSION: 3.12.2
HELM_EXPERIMENTAL_OCI: 1
stages:
- linters
- build
- publish
# yamllint:
# stage: linters
# image:
# name: docker.io/cytopia/yamllint
# entrypoint: ["/bin/ash", "-c"]
# before_script:
# - yamllint --version
# script:
# - yamllint --strict -f colored .
helm lint:
stage: linters
image:
name: docker.io/alpine/helm:$HELM_VERSION
entrypoint: ["/bin/sh", "-c"]
script:
- helm lint charts/*
helm package:
stage: build
image:
name: docker.io/alpine/helm:$HELM_VERSION
entrypoint: ["/bin/sh", "-c"]
before_script:
- helm repo add argo https://argoproj.github.io/argo-helm
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm repo update
script:
- mkdir -p ./publish
- set -x && for i in $(find charts/* -maxdepth 0 -type d); do
helm dependency update $i;
helm dependency build $i;
helm package $i --destination ./publish;
done
artifacts:
paths:
- publish
helm publish to gitlab internal:
stage: publish
variables:
GIT_STRATEGY: none
image:
name: docker.io/curlimages/curl:latest
entrypoint: ["/bin/sh", "-c"]
script:
- set -x && for i in $(find publish/* -type f -name '*.tgz'); do
curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@$i" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts";
done
helm publish to chartmuseum:
stage: publish
variables:
GIT_STRATEGY: none
image:
name: docker.io/curlimages/curl:latest
entrypoint: ["/bin/sh", "-c"]
script:
- set -x && for i in $(find publish/* -type f -name '*.tgz'); do
curl --user $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD --data-binary "@$i" "${CHARTMUSEUM_URL}/api/charts";
done