swarm-gitops/file-preprocessor.sh
Peter Surda 10b5cbec99
All checks were successful
buildbot/travis_bionic Build done.
buildbot/multibuild_parent Build done.
Initial commit
2025-02-06 19:56:37 +08:00

23 lines
355 B
Bash

#!/bin/bash
SUBDIR=files
[ -d $SUBDIR ] || exit
# TODO init variables:
# - secrets
datafile=$(mktemp)
for f in "$SUBDIR/*"; do
# TODO how about symlinks?
[ -f "$f" ] || continue
target="${f%.*}" # strip extension
case "${f##*.}" in
"j2")
j2 "$f" $datafile -o "$target"
;;
esac
done
rm -f $datafile