Skip to content

Commit 571fae1

Browse files
committed
Update templated files to rev 8dedbe5 (#542)
Automatically created PR based on commit 8dedbe57144cf6f0662984d8e4a84d68adcf3d41 in stackabletech/operator-templating repo. Triggered by: Daily run triggered
1 parent c55881b commit 571fae1

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
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
@@ -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

Lines changed: 1 addition & 1 deletion
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

scripts/docs_templating.sh

Lines changed: 41 additions & 0 deletions
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)