This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/quay-entrypoint.sh

59 lines
1.3 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
MODE="$1"
display_usage() {
echo "This script takes one argument."
echo -e "\nUsage: ${0} <shell|config|interactive|batch|both>\n"
}
if [[ "${MODE}" = "help" ]]
then
display_usage
exit 0
fi
cat << "EOF"
__ __
/ \ / \ ______ _ _ __ __ __
/ /\ / /\ \ / __ \ | | | | / \ \ \ / /
/ / / / \ \ | | | | | | | | / /\ \ \ /
\ \ \ \ / / | |__| | | |__| | / ____ \ | |
\ \/ \ \/ / \_ ___/ \____/ /_/ \_\ |_|
\__/ \__/ \ \__
\___\ by Red Hat
Build, Store, and Distribute your Containers
EOF
venv/bin/python -m displayversion
case "$MODE" in
"shell")
echo "Entering shell mode"
/bin/bash
exit 0
;;
"config")
echo "Entering config mode, only copying config-app entrypoints"
cp -r ${QUAYDIR}/config_app/init/service/* /etc/service
;;
"interactive")
echo "Copying $MODE files"
cp -r ${QUAYCONF}/init/service/interactive/* /etc/service
;;
"batch")
echo "Copying $MODE files"
cp -r ${QUAYCONF}/init/service/batch/* /etc/service
;;
*)
echo "Copying all files"
cp -r ${QUAYCONF}/init/service/interactive/* /etc/service
cp -r ${QUAYCONF}/init/service/batch/* /etc/service
;;
esac
/sbin/my_init