This repository was archived by the owner on Oct 14, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-36
lines changed Expand file tree Collapse file tree 1 file changed +10
-36
lines changed Original file line number Diff line number Diff line change @@ -19,42 +19,16 @@ jobs:
19
19
USERNAME : ${{ secrets.HELM_REGISTRY_USERNAME }}
20
20
PASSWORD : ${{ secrets.HELM_REGISTRY_PASSWORD }}
21
21
run : |
22
- package_publish () {
23
- echo "Linting Helm Chart"
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"
24
29
helm lint .
25
- echo "Packaging Helm Chart"
26
30
helm package --version $RELEASE_VERSION .
27
- echo "Publising Helm Chart"
28
- curl --data-binary "@$(cat Chart.yaml | yq read - name)-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
29
- }
30
-
31
- # Publishing
32
-
33
- # Operator
34
- cd operator
35
- package_publish
36
- cd -
37
-
38
- # Scanner
39
- for dir in scanners/*/
40
- do
41
- cd $dir
42
- echo "Processing Chart in: $dir"
43
- if [ -f Chart.yaml ]; then
44
- package_publish
45
- fi
46
- # cd back
47
- cd -
48
- done
49
-
50
- # Hooks
51
- for dir in hooks/*/
52
- do
53
- cd $dir
54
- echo "Processing Chart in: $dir"
55
- if [ -f Chart.yaml ]; then
56
- package_publish
57
- fi
58
- # cd back
59
- cd -
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
+ )
60
34
done
You can’t perform that action at this time.
0 commit comments