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

Commit e70be31

Browse files
authored
Merge pull request #70 from secureCodeBox/helm-publishing
Automatically Publish Helm Charts on Releases
2 parents e832d0e + e65c213 commit e70be31

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.github/workflows/helm-charts.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
release:
3+
types: [published]
4+
name: "Publish Helm Charts"
5+
jobs:
6+
helm:
7+
name: Package and Publish
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: "Install yq"
12+
run: |
13+
sudo snap install yq
14+
- name: Parse Tag
15+
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
16+
- name: "Publish Helm Chart"
17+
env:
18+
HELM_REGISTRY: https://charts.securecodebox.io
19+
USERNAME: ${{ secrets.HELM_REGISTRY_USERNAME }}
20+
PASSWORD: ${{ secrets.HELM_REGISTRY_PASSWORD }}
21+
run: |
22+
# Publish charts in all folders containing a `Chart.yaml` file
23+
# https://github.com/koalaman/shellcheck/wiki/SC2044
24+
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
25+
(
26+
dir="$(dirname "${chart}")"
27+
cd "${dir}" || exit
28+
echo "Processing Chart in $dir"
29+
helm lint .
30+
helm package --version $RELEASE_VERSION .
31+
NAME=$(yq read - name < Chart.yaml)
32+
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
33+
)
34+
done

demo-apps/bodgeit/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
version: 0.1.0
33
type: application
4-
appVersion: "latest"
4+
appVersion: "v1.4.0"
55
name: bodgeit
66
description: "The BodgeIt Store is a vulnerable web app which is aimed at people who are new to pen testing"
77
home: https://github.com/psiinon/bodgeit

demo-apps/juice-shop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
version: 0.1.0
3-
appVersion: "v10.0.0"
3+
appVersion: "v11.1.2"
44
name: juice-shop
55
description: "OWASP Juice Shop: Probably the most modern and sophisticated insecure web application"
66
type: application

0 commit comments

Comments
 (0)