Files
selfphoneng/scripts/update.sh
T
iamdoubz 324f9d9fe2
ci / check (push) Successful in 56s
ci / images (push) Successful in 23s
docs: admin guide (install, voip.ms, network, E911, troubleshooting, updating)
docs/admin-guide/: install and the setup wizard, voip.ms with screenshots, NAT and SIP
ALG, firewall (ufw, nftables limited to the voip.ms POP), fail2ban and CrowdSec, E911
duties, recording consent, troubleshooting (08 §3.3), updating, backup and restore,
monitoring and log rotation. scripts/update.sh as 08 §3.1 describes. The e2e checks
fail2ban's and CrowdSec's stock Asterisk rules against a real failed sign-in, takes the
screenshots and checks every link and anchor.

Task: M11-T7
2026-10-20 08:57:54 -05:00

17 lines
849 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-or-later
# Update to the latest code (08 §3.1). Migrations run when the api starts. Calls in progress drop
# when Asterisk's container is recreated, so run it when the phones are quiet.
# Usage: scripts/update.sh (run from anywhere)
set -eu
cd "$(dirname "$0")/.."
git pull --ff-only
profile=$(docker ps -q --filter label=com.docker.compose.project=selfphoneng --filter label=com.docker.compose.service=caddy | grep -q . && echo '--profile caddy' || true)
# shellcheck disable=SC2086 # empty or one flag
docker compose $profile pull --ignore-buildable # postgres, caddy
# shellcheck disable=SC2086
docker compose $profile build --pull
# shellcheck disable=SC2086
docker compose $profile up -d
echo "Updated to $(sed -n 's/^ "version": "\(.*\)",$/\1/p' package.json) ($(git rev-parse --short HEAD))"