File: /var/www/vhosts/textpony-dev.2amigos.us/docroot/development
#!/bin/bash
# Load environment variables
FILE=.env
if test -f "$FILE"; then
export $(egrep -v '^#' "$FILE" | xargs)
fi
while getopts svfh options; do
case $options in
?)
printf "Execute common tasks using shortcuts.\n"
printf "\nUsage:\n %s: [options] [command]\n" "$0"
printf "\nCommands:\n"
printf " up Create the development environment.\n"
printf " down Stop and destroy the development environment.\n"
printf " build Build the docker images.\n"
printf " logs Display the stack logs.\n"
printf " status Display the container status.\n"
printf " start Start a stopped development environment.\n"
printf " stop Stop a development environment.\n"
printf " nx-graph Serve nx graph.\n"
printf " dev-panel Start panel application development server.\n"
printf "\nOptions:\n"
printf " -h Display help information.\n"
printf "\n"
exit 2
;;
esac
done
shift $((OPTIND - 1))
if [[ -z "${*:1}" ]]; then
exit 1
fi
case "${*:1}" in
"up") docker-compose -f ./infrastructure/textpony-dev/stack.yml up -d ;;
"down") docker-compose -f ./infrastructure/textpony-dev/stack.yml down --remove-orphans ;;
"build") docker-compose -f ./infrastructure/textpony-dev/stack.yml build ;;
"logs") docker-compose -f ./infrastructure/textpony-dev/stack.yml logs ;;
"status") docker-compose -f ./infrastructure/textpony-dev/stack.yml ps -a ;;
"start") docker-compose -f ./infrastructure/textpony-dev/stack.yml start ;;
"stop") docker-compose -f ./infrastructure/textpony-dev/stack.yml stop ;;
"nx-graph") docker-compose -f ./infrastructure/textpony-dev/stack.yml exec workspace nx graph --host=0.0.0.0 ;;
"dev-panel") docker-compose -f ./infrastructure/textpony-dev/stack.yml exec workspace nx run panel:serve --host=0.0.0.0 ;;
"dev-web") docker-compose -f ./infrastructure/textpony-dev/stack.yml exec workspace nx run web:serve --host=0.0.0.0 --port=3333 ;;
*) docker-compose -f ./infrastructure/textpony-dev/stack.yml exec workspace "${@:1}" ;;
esac