forked from secureCodeBox/secureCodeBox
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (131 loc) · 7.13 KB
/
helm-docs.yaml
File metadata and controls
147 lines (131 loc) · 7.13 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# SPDX-FileCopyrightText: 2021 iteratec GmbH
#
# SPDX-License-Identifier: Apache-2.0
name: "Update Helm Docs"
on:
push:
jobs:
helm-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_COMMITS_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_COMMITS_PASSPHRASE }}
git-user-signingkey: true
git-commit-gpgsign: true
- name: Download Helm Docs
run: |
mkdir helm-docs
cd helm-docs
curl --output helm-docs.tar.gz --location https://github.com/norwoodj/helm-docs/releases/download/v1.5.0/helm-docs_1.5.0_Linux_x86_64.tar.gz
# Checksum must be extracted from the checksum file every time helm-docs gets updated.
echo "a352e13a8438045b8ed138b821cb757c177acd999c1af77345152d7a64b0ddb7 helm-docs.tar.gz" | shasum --check
tar -xvf helm-docs.tar.gz
# Verify installation
./helm-docs --version
sudo mv helm-docs /usr/local/bin/helm-docs
- name: Generate Helm Docs
run: |
# Generate README.md based on Chart.yaml and template
helm-docs --template-files=./.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./.helm-docs/README.md.gotmpl
- name: Generate Demo-Apps Docs
run: |
# Start in the hooks folder
cd demo-targets
# https://github.com/koalaman/shellcheck/wiki/SC2044
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
(
dir="$(dirname "${chart}")"
echo "Processing Helm Chart in $dir"
cd "${dir}" || exit
if [ -d "docs" ]; then
echo "Docs Folder found at: ${dir}/docs"
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.DockerHub-Target.md.gotmpl --output-file=docs/README.DockerHub-Target.md
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.ArtifactHub.md.gotmpl --output-file=docs/README.ArtifactHub.md
else
echo "Ignoring Docs creation process for Chart $dir, because no `docs` folder found at: ${dir}/docs"
fi
)
done
- name: Generate Docker Hooks Docs
run: |
# Start in the hooks folder
cd hooks
# https://github.com/koalaman/shellcheck/wiki/SC2044
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
(
dir="$(dirname "${chart}")"
echo "Processing Helm Chart in $dir"
cd "${dir}" || exit
if [ -d "docs" ]; then
echo "Docs Folder found at: ${dir}/docs"
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.DockerHub-Hook.md.gotmpl --output-file=docs/README.DockerHub-Hook.md
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.ArtifactHub.md.gotmpl --output-file=docs/README.ArtifactHub.md
else
echo "Ignoring Docs creation process for Chart $dir, because no `docs` folder found at: ${dir}/docs"
fi
)
done
- name: Generate Docker Scanner Docs
run: |
# Start in the scanners folder
cd scanners
# https://github.com/koalaman/shellcheck/wiki/SC2044
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
(
dir="$(dirname "${chart}")"
echo "Processing Helm Chart in $dir"
cd "${dir}" || exit
if [ -d "docs" ]; then
echo "Docs Folder found at: ${dir}/docs"
if [ -d "parser" ]; then
echo "Parser found at: ${dir}/parser"
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.DockerHub-Parser.md.gotmpl --output-file=docs/README.DockerHub-Parser.md
fi
if [ -d "scanner" ]; then
echo "Scanner found at: ${dir}/parser"
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.DockerHub-Scanner.md.gotmpl --output-file=docs/README.DockerHub-Scanner.md
fi
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.ArtifactHub.md.gotmpl --output-file=docs/README.ArtifactHub.md
else
echo "Ignoring Docs creation process for Chart $dir, because no `docs` folder found at: ${dir}/docs"
fi
)
done
- name: Generate Core (Operator) Docs
run: |
# Start in the operator folder
cd operator
if [ -d "docs" ]; then
echo "Docs Folder found at: operator/docs"
helm-docs --template-files=./../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../.helm-docs/README.DockerHub-Core.md.gotmpl --output-file=docs/README.DockerHub-Core.md
helm-docs --template-files=./../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../.helm-docs/README.ArtifactHub.md.gotmpl --output-file=docs/README.ArtifactHub.md
else
echo "Ignoring Docs creation process for Chart $dir, because no `docs` folder found at: operator/docs"
fi
- name: Generate Core (AutoDiscovery Kubernetes) Docs
run: |
cd auto-discovery/kubernetes
if [ -d "docs" ]; then
echo "Docs Folder found at: auto-discovery/kubernetes/docs"
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.DockerHub-Core.md.gotmpl --output-file=docs/README.DockerHub-Core.md
helm-docs --template-files=./../../.helm-docs/templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=./../../.helm-docs/README.ArtifactHub.md.gotmpl --output-file=docs/README.ArtifactHub.md
else
echo "Ignoring Docs creation process for Chart $dir, because no `docs` folder found at: auto-discovery/kubernetes/docs"
fi
- name: Remove Helm Docs Files
run: |
# Remove helm-docs download to ensure they don't get committed back
rm -rf helm-docs
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
with:
commit_message: Updating Helm Docs
commit_user_email: securecodebox@iteratec.com
# Optional. Used by `git-commit`.
# See https://git-scm.com/docs/git-commit#_options
commit_options: '--signoff'