lab-ansible/roles/apps/templates/scripts/deploy.sh.j2

34 lines
705 B
Plaintext
Raw Normal View History

# THIS FILE IS MANAGED BY ANSIBLE
# vim: ft=bash
2023-11-11 15:21:29 +00:00
# code: language=bash
#!/usr/bin/env bash
2023-11-11 15:21:29 +00:00
ARG="$1"
APPS_DIR="{{ apps_data_root }}"
case $ARG in
start)
for app in $APPS_DIR/*; do
docker compose -f $app/docker-compose.yml up --remove-orphans -d
done
;;
stop)
for app in $APPS_DIR/*; do
docker compose -f $app/docker-compose.yml down --remove-orphans
done
;;
restart)
for app in $APPS_DIR/*; do
docker compose -f $app/docker-compose.yml restart
done
;;
2023-12-31 17:20:28 +00:00
reload-proxy)
docker compose -f $APPS_DIR/nginx/docker-compose.yml exec web \
sh -c "nginx -t && nginx -s reload"
;;
2023-11-11 15:21:29 +00:00
*)
echo "Unrecognized argument"
exit 1
;;
esac