prole/install.sh
chrisfu 5715add366 feat: GitLab deployment pipeline — operator fix, CI config, and namespace isolation
- etc/init_gitlab.sh: Add global.redis block (host/port/auth) to the GitLab CR so
  the chart does not fail NOTES.txt validation when redis.install: false.
  Drop the GITOPS_NAMESPACE config fallback in namespace resolution to prevent the
  Gitea namespace from bleeding into GitLab deployments; GITLAB_NAMESPACE is now the
  sole source of truth with a hard default of "gitlab".
- knoe/core/milestones.py: Fix GitOpsMilestone to route to init_gitlab.sh when
  gitops.git_provider = GitLab (was hardcoded to init_gitea.sh). Namespace resolution
  now prefers gitops.gitlab_namespace input key, then gitops.namespace, then "gitlab" —
  never picks up a stale GITLAB_NAMESPACE from the OS environment.
- conf/service/prole.cfg: Switch gitops.git_provider / GITOPS_PROVIDER to GitLab.
  Update accumulated runtime state from install runs.
- install.sh: Prefer the repo-local venv Python (PROLE_HOME/bin/python3) so that
  PyYAML and other prole_requirements.txt deps are always available.
- .gitlab-ci.yml: New CI pipeline — on every push to main, run the silent install
  (./install.sh -S -c conf/service/prole.cfg) to deploy a fresh CNPG ecosystem.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 15:26:39 -07:00

51 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Thin launch vehicle for the Prole installer.
#
# Local execution (from a repo checkout):
# ./install.sh [args...]
#
# Bootstrap via curl (first-time install):
# curl -fsSL https://knoey.com/install.sh | bash
set -euo pipefail
# Repo URL used only during bootstrap (curl-pipe) installs.
PROLE_REPO_URL="${PROLE_REPO_URL:-https://gitlab.knoey.com/prole/prole.git}"
# Default install directory for bootstrap installs.
_INSTALL_DIR="${PROLE_HOME:-$HOME/prole}"
_bootstrap() {
echo "==> Bootstrapping Prole installer..."
command -v git >/dev/null 2>&1 || { echo "Error: git is required." >&2; exit 1; }
command -v python3 >/dev/null 2>&1 || { echo "Error: python3 is required." >&2; exit 1; }
if [[ -d "${_INSTALL_DIR}/.git" ]]; then
echo "==> Updating existing checkout at ${_INSTALL_DIR} ..."
git -C "${_INSTALL_DIR}" pull --ff-only
else
echo "==> Cloning to ${_INSTALL_DIR} ..."
git clone "${PROLE_REPO_URL}" "${_INSTALL_DIR}"
fi
exec "${_INSTALL_DIR}/install.sh" "$@"
}
# Resolve script directory; empty when running via curl pipe.
_src="${BASH_SOURCE[0]:-}"
_script_dir="$(cd "$(dirname "${_src:-/}")" 2>/dev/null && pwd || echo "")"
if [[ -n "${_script_dir}" && -d "${_script_dir}/knoe" ]]; then
# Local checkout: delegate to the Python installer module.
cd "${_script_dir}"
# Prefer the venv Python at PROLE_HOME (or the repo root) when available;
# it carries all prole_requirements.txt dependencies.
_VENV_PYTHON="${PROLE_HOME:-${_script_dir}}/bin/python3"
if [[ -x "${_VENV_PYTHON}" ]]; then
exec "${_VENV_PYTHON}" -m knoe.ui.screens "$@"
fi
exec python3 -m knoe.ui.screens "$@"
else
# No local checkout found — bootstrap from the remote repo.
_bootstrap "$@"
fi