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

30 lines
572 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
;;
*)
echo "Unrecognized argument"
exit 1
;;
esac