grim/convey

closing merged branch
expand-list
2017-10-03, Gary Kramlich
345a52ef04c6
file isExecutable
closing merged branch
#!/bin/sh
set -ex
if [ -z $TEMPLATE_OUTPUT ]; then
echo 'TEMPLATE_OUTPUT was not specified';
exit 1;
fi
if [ -z $TEMPLATE_STRING ]; then
if [ -z $TEMPLATE_FILE ]; then
echo 'Either TEMPLATE_STRING or TEMPLATE_FILE must be set';
exit 1;
fi;
if [ ! -e ${CONVEY_WORKSPACE}/${TEMPLATE_FILE} ]; then
echo "Could not find template file ${TEMPLATE_FILE}";
exit 1;
fi;
TEMPLATE_STRING=$(cat ${CONVEY_WORKSPACE}/${TEMPLATE_FILE})
fi
echo -e "$TEMPLATE_STRING" | envsubst > ${CONVEY_WORKSPACE}/${TEMPLATE_OUTPUT}