Skip to content

Commit 71bd394

Browse files
committed
Update templated files to rev ec90de0 (#331)
Automatically created PR based on commit ec90de0cf4e1140c3a6771146f75be20fa95608b in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: siegfriedweber with message [Configure yamllint to accept non-indented sequences which are produced by serde_yaml:0.9]
1 parent 15bc8b0 commit 71bd394

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
6262
with:
6363
submodules: recursive
64-
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # tag=v4
64+
- uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
6565
- name: Install requirements for version tool
6666
run: pip install -r python/requirements.txt
6767
- id: prerelease
@@ -272,7 +272,7 @@ jobs:
272272
run: git diff --exit-code
273273
- name: Git Diff showed uncommitted changes
274274
if: ${{ failure() }}
275-
uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # tag=v6
275+
uses: actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # tag=v6
276276
with:
277277
script: |
278278
core.setFailed('Committed charts were not up to date, please regenerate and re-commit!')
@@ -316,7 +316,7 @@ jobs:
316316
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
317317
with:
318318
submodules: recursive
319-
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # tag=v4
319+
- uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
320320
if: ${{ github.event_name == 'pull_request' }}
321321
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
322322
with:

.github/workflows/reviewdog.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
25-
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # tag=v4
25+
- uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
2626
with:
2727
python-version: "3.9"
2828
- uses: reviewdog/action-flake8@b6435e67f0cfda225b9e0c9283cfb7ea7c551bdb # tag=v3.6.0

.yamllint.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ rules:
1010
check-keys: false
1111
comments:
1212
min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
13+
indentation:
14+
indent-sequences: consistent

scripts/docs_templating.sh

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Reads a file with variables to insert into templates, and templates all .*.j2 files
5+
# in the 'docs' directory.
6+
#
7+
# dependencies
8+
# pip install jinja2-cli
9+
10+
docs_dir="$(dirname "$0")/../docs"
11+
templating_vars_file="$docs_dir/templating_vars.yaml"
12+
13+
# Check if files need templating
14+
if [[ -z $(find "$docs_dir" -name '*.j2') ]];
15+
then
16+
echo "No files need templating, exiting."
17+
exit
18+
fi
19+
20+
# Check if jinja2 is there
21+
if ! command -v jinja2 &> /dev/null
22+
then
23+
echo "jinja2 could not be found. Use 'pip install jinja2-cli' to install it."
24+
exit
25+
fi
26+
27+
# Check if templating vars file exists
28+
if [[ ! -f "$templating_vars_file" ]];
29+
then
30+
echo "$templating_vars_file does not exist, cannot start templating."
31+
fi
32+
33+
find "$docs_dir" -name '*.j2' |
34+
while read -r file
35+
do
36+
new_file_name=${file%.j2} # Remove .j2 suffix
37+
echo "templating $new_file_name"
38+
jinja2 "$file" "$templating_vars_file" -o "$new_file_name"
39+
done
40+
41+
echo "done"

0 commit comments

Comments
 (0)