lab-ansible/roles/apps/templates/scripts/deploy.sh.j2
2023-11-11 16:21:29 +01:00

28 lines
523 B
Django/Jinja

#!/usr/bin/env bash
# code: language=bash
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