MT#16391 Support custom output directories

This let's us control the directory where files should be written to.
Otherwise we'd have to write to the system's /etc/ + /var, which is
clearly unwanted.

Change-Id: I1010afcd4637928868fc81a0adfafebd3bbce874
changes/30/13430/3
Michael Prokop 9 years ago
parent d62433cf93
commit 55fa597f54

@ -34,9 +34,15 @@ input_file="$1" # like /etc/ngcp-config/templates/etc/mysql/my.cnf.tt2
[ -n "${PAIR_FILE:-}" ] && y=${y%%.tt2${PAIR_FILE}} # drop trailing suffix '.tt2.pairname'
[ -n "${HOST_FILE:-}" ] && y=${y%%.tt2${HOST_FILE}} # drop trailing suffix '.tt2.hostname'
y=${y%%.customtt} # drop trailing suffix '.customtt'
# export variable for usage within {pre,post}build scripts,
# OUTPUT_DIRECTORY is for customization during testing
if [ -n "${OUTPUT_DIRECTORY:-}" ] ; then
log_debug "Using output directory $OUTPUT_DIRECTORY"
export output_file="${OUTPUT_DIRECTORY}/${y}"
else
export output_file="${y}"
fi
# }}}
export output_file="${y}" # like /etc/mysql/my.cnf, export variable
# for usage within {pre,post}build scripts
# pre-execution script in template store:
if [ -r "${NGCPCTL_MAIN}/templates/${output_file}.prebuild" ] ; then

Loading…
Cancel
Save