This repository was archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (61 loc) · 2.65 KB
/
helm-charts.yaml
File metadata and controls
61 lines (61 loc) · 2.65 KB
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
on:
release:
types: [published]
name: "Publish Helm Charts"
jobs:
helm:
name: Package and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Install yq"
run: |
sudo snap install yq
- name: Parse Tag
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
- name: "Publish Helm3 Charts"
env:
HELM_REGISTRY: https://charts.securecodebox.io
USERNAME: ${{ secrets.HELM_REGISTRY_USERNAME }}
PASSWORD: ${{ secrets.HELM_REGISTRY_PASSWORD }}
run: |
# Publish all helm3 charts in all folders containing a `Chart.yaml` file
# https://github.com/koalaman/shellcheck/wiki/SC2044
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
(
dir="$(dirname "${chart}")"
cd "${dir}" || exit
echo "Processing Helm3 Chart in $dir"
helm package --version $RELEASE_VERSION .
NAME=$(yq read - name < Chart.yaml)
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
)
done
- name: "Publish Helm2 Charts"
env:
HELM_REGISTRY: https://charts-helm2.securecodebox.io
USERNAME: ${{ secrets.HELM_REGISTRY_USERNAME }}
PASSWORD: ${{ secrets.HELM_REGISTRY_PASSWORD }}
run: |
# Publish all helm2 charts in all folders containing a `helm2.Chart.yaml` file
# https://github.com/koalaman/shellcheck/wiki/SC2044
find . -type f -name helm2.Chart.yaml -print0 | while IFS= read -r -d '' chart; do
(
dir="$(dirname "${chart}")"
cd "${dir}" || exit
mv Chart.yaml helm3.Chart.yaml
mv helm2.Chart.yaml Chart.yaml
if [ "$(basename "$PWD")" = "operator" ]
then
echo "Copying CRDS to templates folder, as helm2 doesn't have native crds support."
cp -R crds templates/crds
fi
echo "Restoring Helm2 Chart and replace Helm3 Chart temporary"
[ ! -f helm2.requirements.lock ] || mv helm2.requirements.lock requirements.lock
[ ! -f helm2.requirements.yaml ] || mv helm2.requirements.yaml requirements.yaml
echo "Processing Helm2 Chart in $dir"
helm package --version $RELEASE_VERSION .
NAME=$(yq read - name < Chart.yaml)
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
)
done