19 lines
507 B
Bash
Executable File
19 lines
507 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo 'Run this deployment build as root: sudo ./build.sh' >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Check the service account before replacing dist.
|
|
sunrise_group=$(id -gn sunrise)
|
|
git pull --ff-only
|
|
npm run build
|
|
install -d -o sunrise -g "$sunrise_group" -m 755 dist/threads-captures
|
|
systemctl restart sunrise-threads.service
|
|
|
|
echo 'Build complete; capture permissions restored and sunrise-threads.service restarted.'
|