Files
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

20 lines
648 B
Django/Jinja

#!/bin/bash
set -Eeuxo pipefail
# Deploy an image
# ./buildbtw-deploy-image.sh <image tag>
image_tag=$1
# Restart so that a potentially newer image may get pulled
echo "Deploying ${image_tag}"
mkdir -p "{{ buildbtw_dir }}"/instances/${image_tag}
systemctl restart "buildbtw@${image_tag}"
{% if buildbtw_stage == "review" %}
# Manual symlink (as suggested in podman-systemd.unit(5) because this will
# generate a service and generated/transient services can't be enabled. We can
# manually instantiate them, however, to make sure they run on boot.
ln -sf buildbtw@.container "/etc/containers/systemd/buildbtw@${image_tag}.container"
{% endif %}