Ian Fijolek
03406f4105
All checks were successful
continuous-integration/drone/push Build is passing
26 lines
528 B
Bash
Executable File
26 lines
528 B
Bash
Executable File
#! /bin/bash
|
|
|
|
INPUT_DIR=${INPUT_DIR:-/templates}
|
|
OUTPUT_DIR=${OUTPUT_DIR:-/config}
|
|
|
|
shopt -s globstar
|
|
|
|
echo "Running at $(date)..."
|
|
|
|
for f in "$INPUT_DIR"/**/* ; do
|
|
of="$OUTPUT_DIR${f#$INPUT_DIR}"
|
|
if [ ! -f "$f" ]; then
|
|
echo " > Skipping: $f not a file"
|
|
continue
|
|
fi
|
|
if [ "$f" -nt "$of" ]; then
|
|
echo " > Generating new $of"
|
|
mkdir -p "$(dirname $of)"
|
|
gomplate $FLAGS -f "$f" -o "$of"
|
|
else
|
|
echo " > Skipping: $f because $of is newer"
|
|
fi
|
|
done
|
|
|
|
echo "Complete"
|