This commit is contained in:
Tiara Rodney 2026-03-14 05:38:45 +01:00
commit 883f31932e
No known key found for this signature in database
GPG key ID: 5CD8EC1D46106723
169 changed files with 5676 additions and 0 deletions

45
scripts/prod-deploy.sh Executable file
View file

@ -0,0 +1,45 @@
#!/bin/sh
# Deploy to production.
#
# Usage:
# scripts/prod-deploy.sh # full deployment
# scripts/prod-deploy.sh <service> # targeted deployment
# scripts/prod-deploy.sh <service> --skip docker,apache
set -eu
INVENTORY=ansible/inventories/prod/hosts.ini
PLAYBOOK=ansible/playbooks/setup.yml
service=""
skip_tags=""
while [ $# -gt 0 ]; do
case "$1" in
--skip)
skip_tags="$2"
shift 2
;;
-*)
echo "Unknown option: $1" >&2
exit 1
;;
*)
service="$1"
shift
;;
esac
done
if [ -n "$service" ]; then
echo "==> Deploying to production: $service"
if [ -n "$skip_tags" ]; then
exec ansible-playbook -i "$INVENTORY" "$PLAYBOOK" \
--tags "$service" --skip-tags "$skip_tags"
else
exec ansible-playbook -i "$INVENTORY" "$PLAYBOOK" \
--tags "$service"
fi
else
echo "==> Full production deployment"
exec ansible-playbook -i "$INVENTORY" "$PLAYBOOK"
fi