repositories / bugabinga.net
bugabinga.net
personal infrastructure for bugabinga!
owned by admin
scripts/local/load-luci-image.sh
Raw#!/usr/bin/env bash
set -euo pipefail
host="${1:-klops}"
port="${2:-22}"
publish_user="${3:-oli}"
default_image="localhost/bugabinga-luci:latest"
image="${LUCI_IMAGE:-${default_image}}"
[[ "${image}" == "${default_image}" ]] || {
echo "LUCI_IMAGE must remain ${default_image}; the installed Quadlet selects this image" >&2
exit 2
}
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
context="${LUCI_CONTEXT:-${repo_root}/services/luci}"
echo "ensuring ci user exists on ${host}"
"${repo_root}/scripts/local/klops.sh" run-remote "${host}" "${port}" root "${repo_root}/scripts/remote/setup-ci-user.sh" "${publish_user}"
echo "retaining the current Luci image for rollback"
"${repo_root}/scripts/local/klops.sh" run-remote "${host}" "${port}" root "${repo_root}/scripts/remote/start-luci.sh" backup
"${repo_root}/scripts/local/build-remote-image.sh" "${host}" "${port}" ci "${image}" "${context}"
echo "restarting Luci and checking HTTP and forced SSH"
"${repo_root}/scripts/local/klops.sh" run-remote "${host}" "${port}" root "${repo_root}/scripts/remote/start-luci.sh" deploy