Skip to content

Commit

Permalink
fix: Replace j2cli with jinjanator in GitHub workflows
Browse files Browse the repository at this point in the history
j2cli is unmaintained and no longer works with python3.12. It is
therefore replaced with an active fork called jinjanator.

The improper use of the '-e' flag on the j2 binary is fixed. Since the
env is used as data source there is also no need to import variables
explicitly again.

Signed-off-by: Felix Matouschek <[email protected]>
  • Loading branch information
0xFelix authored and maiqueb committed Oct 31, 2023
1 parent fea6864 commit 98d3bea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
python-version: 3.x

- run: |
pip3 install --user --upgrade j2cli
pip3 install --user --upgrade jinjanator
ln -s ~/.local/bin/jinjanate ~/.local/bin/j2
j2 --version
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/e2e-containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
python-version: 3.x

- run: |
pip3 install --user --upgrade j2cli
pip3 install --user --upgrade jinjanator
ln -s ~/.local/bin/jinjanate ~/.local/bin/j2
j2 --version
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/image-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
- name: Install the j2 dependency
if: startsWith(github.ref, 'refs/tags/')
run: |
pip3 install --user --upgrade j2cli
pip3 install --user --upgrade jinjanator
ln -s ~/.local/bin/jinjanate ~/.local/bin/j2
j2 --version
- name: Template release manifests
Expand Down
4 changes: 2 additions & 2 deletions hack/generate_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ templates_dir="$ROOT/templates"
for file in `ls $templates_dir/`; do
echo $file
if [ -z $CRIO_RUNTIME ]; then
j2 -e MULTUS_SOCKET_PATH -e IMAGE_REGISTRY -e IMAGE_TAG -e CRI_SOCKET_PATH -e NAMESPACE ${templates_dir}/$file -o "manifests/${file%.j2}"
j2 ${templates_dir}/$file -o "manifests/${file%.j2}"
else
if [ $file != "dynamic-networks-controller.yaml.j2" ]; then
continue
fi
j2 -e MULTUS_SOCKET_PATH -e CRIO_RUNTIME -e IMAGE_REGISTRY -e IMAGE_TAG -e CRI_SOCKET_PATH -e NAMESPACE ${templates_dir}/$file -o "manifests/crio-${file%.j2}"
j2 ${templates_dir}/$file -o "manifests/crio-${file%.j2}"
fi
done
unset IMAGE_REGISTRY
Expand Down

0 comments on commit 98d3bea

Please sign in to comment.