Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 076d3d8

Browse files
committed
Trying to support helm2 in parallel to helm3 (WIP).
1 parent 25b548d commit 076d3d8

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

.github/workflows/helm-charts.yaml

+26-3
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,42 @@ jobs:
1313
sudo snap install yq
1414
- name: Parse Tag
1515
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
16-
- name: "Publish Helm Chart"
16+
- name: "Publish Helm3 Charts"
1717
env:
1818
HELM_REGISTRY: https://charts.securecodebox.io
1919
USERNAME: ${{ secrets.HELM_REGISTRY_USERNAME }}
2020
PASSWORD: ${{ secrets.HELM_REGISTRY_PASSWORD }}
2121
run: |
22-
# Publish charts in all folders containing a `Chart.yaml` file
22+
# Publish all helm3 charts in all folders containing a `Chart.yaml` file
2323
# https://github.com/koalaman/shellcheck/wiki/SC2044
2424
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
2525
(
2626
dir="$(dirname "${chart}")"
2727
cd "${dir}" || exit
28-
echo "Processing Chart in $dir"
28+
echo "Processing Helm3 Chart in $dir"
29+
helm package --version $RELEASE_VERSION .
30+
NAME=$(yq read - name < Chart.yaml)
31+
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
32+
)
33+
done
34+
- name: "Publish Helm2 Charts"
35+
env:
36+
HELM_REGISTRY: https://charts.securecodebox.io
37+
USERNAME: ${{ secrets.HELM_REGISTRY_USERNAME }}
38+
PASSWORD: ${{ secrets.HELM_REGISTRY_PASSWORD }}
39+
run: |
40+
# Publish all helm2 charts in all folders containing a `helm2.Chart.yaml` file
41+
# https://github.com/koalaman/shellcheck/wiki/SC2044
42+
find . -type f -name helm2.Chart.yaml -print0 | while IFS= read -r -d '' chart; do
43+
(
44+
dir="$(dirname "${chart}")"
45+
cd "${dir}" || exit
46+
mv Chart.yaml helm3.Chart.yaml
47+
echo "Restoring Helm2 Chart and replace Helm3 Chart temporary"
48+
mv helm2.Chart.yaml Chart.yaml
49+
[ ! -f helm2.requirements.lock ] || mv helm2.requirements.lock requirements.lock
50+
[ ! -f helm2.requirements.yaml ] || mv helm2.requirements.yaml requirements.yaml
51+
echo "Processing Helm2 Chart in $dir"
2952
helm package --version $RELEASE_VERSION .
3053
NAME=$(yq read - name < Chart.yaml)
3154
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"

operator/helm2.Chart.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
name: operator
3+
description: secureCodeBox Operator to automate the execution of security scans on kubernetes
4+
5+
type: application
6+
7+
# version - gets automatically set to the secureCodeBox release version when the helm charts gets published
8+
version: latest

operator/helm2.requirements.lock

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: minio
3+
repository: https://kubernetes-charts.storage.googleapis.com/
4+
version: 5.0.19
5+
digest: sha256:13a3a902e7ac7dcc7124ab858344b5bebe9ab623d06ee9c8d5a1cc3f467a36bb
6+
generated: "2020-08-10T13:09:59.053995+02:00"

operator/helm2.requirements.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies:
2+
- name: minio
3+
version: 5.0.19
4+
repository: https://kubernetes-charts.storage.googleapis.com/
5+
condition: minio.enabled

0 commit comments

Comments
 (0)