1
0
angie-conv-image/image-entry.d/53-expand-templates.sh

31 lines
638 B
Bash
Raw Normal View History

2024-07-11 13:37:35 +03:00
#!/bin/sh
2024-07-16 11:27:22 +03:00
set -f
2024-07-11 13:37:35 +03:00
. /image-entry.d/00-common.envsh
2024-07-16 11:27:22 +03:00
[ "${NGX_STRICT_LOAD}" = 0 ] || set -e
expand_error() {
[ "${expand_error_seen:-}" = 1 ] || log_always 'template expansion has failed'
expand_error_seen=1
if [ "${NGX_STRICT_LOAD}" = 1 ] ; then
t=10
log_always "injecting delay for $t seconds"
sleep $t
exit 1
fi
}
2024-07-16 02:43:08 +03:00
dirs='conf mod modules njs site snip'
[ "${NGX_PROCESS_STATIC}" = 0 ] || dirs="${dirs} static"
for n in ${dirs} ; do
merged_dir="${merged_root}/$n"
[ -d "${merged_dir}" ] || continue
2024-07-16 11:27:22 +03:00
expand_dir_envsubst "${merged_dir}/" || expand_error
expand_dir_jinja "${merged_dir}/" || expand_error
2024-07-16 02:43:08 +03:00
done
2024-07-11 13:37:35 +03:00
exit 0