mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
43 lines
1.5 KiB
Bash
Executable file
43 lines
1.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# Install built Arch packages and enable services
|
|
# Requires: sudo privileges for pacman and systemctl
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/../../../" && pwd)
|
|
cd "$ROOT_DIR"
|
|
|
|
shopt -s nullglob
|
|
PKGS=()
|
|
for p in packaging/arch/solstice-orchestrator/*.pkg.tar.* packaging/arch/solstice-forge-integration/*.pkg.tar.*; do
|
|
PKGS+=("$p")
|
|
done
|
|
|
|
if [[ ${#PKGS[@]} -eq 0 ]]; then
|
|
echo "No packages found. Build first: mise run pkg:build" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Installing: ${PKGS[*]}" >&2
|
|
sudo pacman -U --noconfirm "${PKGS[@]}"
|
|
|
|
# Place example env files if not present
|
|
sudo install -d -m 755 /etc/solstice
|
|
if [[ ! -f /etc/solstice/orchestrator.env ]]; then
|
|
sudo install -m 644 packaging/arch/solstice-orchestrator/orchestrator.env.example /etc/solstice/orchestrator.env
|
|
fi
|
|
if [[ ! -f /etc/solstice/forge-integration.env ]]; then
|
|
sudo install -m 644 packaging/arch/solstice-forge-integration/forge-integration.env.example /etc/solstice/forge-integration.env
|
|
fi
|
|
# Ship example orchestrator image map if none present
|
|
if [[ ! -f /etc/solstice/orchestrator-image-map.yaml ]]; then
|
|
sudo install -m 644 examples/orchestrator-image-map.yaml /etc/solstice/orchestrator-image-map.yaml
|
|
fi
|
|
|
|
# Reload systemd and optionally enable services
|
|
sudo systemctl daemon-reload
|
|
if [[ "${SOL_ENABLE_SERVICES:-1}" == "1" ]]; then
|
|
sudo systemctl enable --now solstice-orchestrator.service || true
|
|
sudo systemctl enable --now solstice-forge-integration.service || true
|
|
fi
|
|
|
|
echo "Done. Adjust /etc/solstice/*.env and /etc/solstice/orchestrator-image-map.yaml as needed." >&2
|