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

28 lines
523 B
Plaintext
Raw Normal View History

2023-11-11 15:21:29 +00:00
#!/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