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

30 lines
680 B
Plaintext
Raw Normal View History

# THIS FILE IS MANAGED BY ANSIBLE
# vim: ft=bash
2023-11-13 20:17:17 +00:00
# code: language=bash
#!/usr/bin/env bash
2023-11-13 20:17:17 +00:00
ARG="$1"
2023-12-22 20:57:19 +00:00
PROXY_DIR="{{ proxy_data_root }}"
2023-11-13 20:17:17 +00:00
case $ARG in
start)
docker compose -f $PROXY_DIR/docker-compose.yml up --remove-orphans -d
;;
stop)
docker compose -f $PROXY_DIR/docker-compose.yml down --remove-orphans
;;
restart)
docker compose -f $PROXY_DIR/docker-compose.yml restart
;;
2023-12-31 17:20:28 +00:00
reload-proxy)
CADDYFILE="/etc/caddy/Caddyfile"
docker compose -f $PROXY_DIR/docker-compose.yml exec caddy \
sh -c "caddy validate -c $CADDYFILE && caddy reload -c $CADDYFILE" \
2>/dev/null
;;
2023-11-13 20:17:17 +00:00
*)
echo "Unrecognized argument"
exit 1
;;
esac