Files
infrastructure/roles/buildbtw/templates/buildbtw-undeploy-image.sh.j2
Sven-Hendrik Haase e0a914ebb4 buildbtw: Switch to instance-dirs
Earlier all of buildbtw would live in the same dir at /var/lib/buildbtw which was especially annoying for the review instances
where we'd get 10s of databases in the same dir. This now also correctly cleans up old instance dirs.
2026-09-11 19:13:36 +02:00

18 lines
416 B
Django/Jinja

#!/bin/bash
set -Eeuxo pipefail
# Undeploy an image
# ./buildbtw-undeploy-image.sh <image tag>
image_tag=$1
echo "Undeploying ${image_tag}"
systemctl stop "buildbtw@${image_tag}"
rm -r "{{ buildbtw_dir }}"/instances/${image_tag}
{% if buildbtw_stage == "review" %}
# Clean up manually created symlink.
# See `buildbtw-deploy-image.sh`.
rm -f "/etc/containers/systemd/buildbtw@${image_tag}.container"
{% endif %}