2026-07-14 12:26:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
APP_DIR=$HOME/tefter
|
|
|
|
|
SERVICE=tefter.service
|
|
|
|
|
|
|
|
|
|
cd "$APP_DIR"
|
|
|
|
|
|
2026-07-14 12:39:25 +02:00
|
|
|
# Host-specific settings (WEB_PORT, GOPROXY, ...) live in .env.docker next to
|
|
|
|
|
# the compose file; export them so compose interpolation sees them.
|
|
|
|
|
set -a; [ -f .env.docker ] && . ./.env.docker; set +a
|
|
|
|
|
WEB_PORT=${WEB_PORT:-8420}
|
2026-07-14 12:26:01 +02:00
|
|
|
|
|
|
|
|
echo "==> Pulling latest code..."
|
|
|
|
|
git pull
|
|
|
|
|
|
|
|
|
|
echo "==> Rebuilding container..."
|
|
|
|
|
TEFTER_VERSION=$(git describe --tags --always --dirty) podman-compose build
|
|
|
|
|
|
|
|
|
|
echo "==> Restarting service..."
|
|
|
|
|
systemctl --user restart $SERVICE
|
|
|
|
|
|
|
|
|
|
echo "==> Waiting for boot..."
|
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
|
|
if curl -s -o /dev/null -w "" http://localhost:$WEB_PORT/; then
|
|
|
|
|
echo "==> Deploy successful! App is running on port $WEB_PORT."
|
|
|
|
|
podman-compose logs --tail 5 tefter 2>&1
|
|
|
|
|
else
|
|
|
|
|
echo "==> WARNING: App may not be ready yet. Check logs:"
|
|
|
|
|
podman-compose logs --tail 20 tefter 2>&1
|
|
|
|
|
fi
|