Make API deployment idempotent on staged repository

This commit is contained in:
juvenal.diaz 2026-10-29 09:27:13 -06:00
parent fed3c21d68
commit f3cb08ecad
1 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,13 @@ command -v go >/dev/null 2>&1 || { echo 'Go is required on Debian' >&2; exit 1;
sudo install -d -m 0755 "${install_dir}" "${repo_root}" /etc/jeannie
sudo cp infra/jeannie-temporal/docker-compose.yml "${install_dir}/docker-compose.yml"
sudo cp -R . "${repo_root}/"
current_repo="$(pwd -P)"
target_repo="$(cd "${repo_root}" && pwd -P)"
if [[ "${current_repo}" != "${target_repo}" ]]; then
sudo cp -R . "${repo_root}/"
else
echo "Repository already staged at ${repo_root}; skipping self-copy."
fi
sudo chown -R "$(id -u):$(id -g)" "${repo_root}"
if command -v ss >/dev/null 2>&1 &&