grim/containers/trac-bootstrap

Beef up the readme
draft
2021-04-11, Gary Kramlich
2338a63e5d7e
file isExecutable
Beef up the readme
#!/bin/sh -e
if [ -z "${S3_URL}" ] ; then
echo "S3_URL environment variable must be set" >&2
exit 1
fi
if [ -z "${S3_KEY}" ] ; then
echo "S3_KEY environment variable must be set" >&2
exit
fi
if [ -z "${S3_ACCESS_KEY}" ] ; then
echo "S3_ACCESS_KEY environment variable must be set" >&2
exit 1
fi
if [ -z "${S3_SECRET_KEY}" ] ; then
echo "S3_SECRET_KEY environment variable must be set" >&2
exit 1
fi
if [ -z "${DESTINATION}" ] ; then
echo "DESTINATION environment variable must be set" >&2
exit 1
fi
# make sure we're not already bootstrapped
if [ -f "${DESTINATION}/conf/trac.ini" ] ; then
echo "${DESTINATION} has already been boot strapped"
exit 0
fi
# create our alias in mc
mc alias set trac-bootstrap "${S3_URL}" "${S3_ACCESS_KEY}" "${S3_SECRET_KEY}"
mc cat "trac-bootstrap/${S3_KEY}" | tar -C "${DESTINATION}"
exit $?