Release v2.17.1: Persist core.sshCommand for the 3 VPS deploy-key repos only, use HTTPS for the remaining 3 repos, and preserve VPS changes during autostash rebase without resetting README.md
This commit is contained in:
1 parent
fff43cca6d
commit
d95446fc6c
2 files changed
+44
-11
No files matched your search
@@ -128,9 +128,11 @@ fi
|
||||
|
||||
if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" ]]; then
|
||||
echo "[4/5] Committing and pushing automated VPS telemetry updates to git.libre.audio..."
|
||||
run_checked "hs-readme-sync --all" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --all
|
||||
run_checked "hs-readme-sync --install-hooks" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --install-hooks
|
||||
DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio"
|
||||
GIT_SSH_CMD="ssh -i ${DEPLOY_KEY} -p 2222 -o IdentitiesOnly=yes -o IdentityAgent=none -o BatchMode=yes -o StrictHostKeyChecking=accept-new"
|
||||
export GIT_SSH_COMMAND="${GIT_SSH_CMD}"
|
||||
unset SSH_AUTH_SOCK || true
|
||||
GIT_SSH_FLAGS=(-c "core.sshCommand=${GIT_SSH_CMD}")
|
||||
STAMP_UTC="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
for r in hyperstitionstudio-core ingglish-hyperdope-gematria encyclopedia-knowledge-graph; do
|
||||
@@ -138,18 +140,19 @@ if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_li
|
||||
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
|
||||
echo " -> Inspecting ${r} for telemetry updates..."
|
||||
fi
|
||||
if ! git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name 2>&1; then
|
||||
if [[ -z "$(git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name || true)" ]]; then
|
||||
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name "Hyperstition VPS Bot"
|
||||
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.email "vps-bot@hyperstitionstud.io"
|
||||
fi
|
||||
forge_ssh="ssh://git@git.libre.audio:2222/seasharp"
|
||||
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config core.sshCommand "${GIT_SSH_CMD}" || true
|
||||
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" remote set-url origin "${forge_ssh}/${r}.git" || true
|
||||
git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" add -A
|
||||
if ! git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" diff --cached --quiet; then
|
||||
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
|
||||
echo " [commit] Committing new telemetry changes in ${r}..."
|
||||
fi
|
||||
run_checked "git commit (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})" || true
|
||||
run_checked "git commit (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})"
|
||||
else
|
||||
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
|
||||
echo " [clean] Repository ${r} working tree is clean (no new local telemetry changes to commit)."
|
||||
@@ -158,13 +161,22 @@ if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_li
|
||||
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
|
||||
echo " [sync] Pulling and rebasing origin/main for ${r}..."
|
||||
fi
|
||||
run_checked "git pull --rebase --autostash (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" pull --rebase --autostash origin main || true
|
||||
run_checked "git pull --rebase --autostash (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" pull --rebase -X theirs --autostash origin main
|
||||
unmerged_paths="$(git -C "${REPOS_ROOT}/${r}" diff --name-only --diff-filter=U || true)"
|
||||
if [[ -n "${unmerged_paths}" ]]; then
|
||||
while IFS= read -r uf; do
|
||||
[[ -z "${uf}" ]] && continue
|
||||
git -C "${REPOS_ROOT}/${r}" checkout --theirs -- "${uf}"
|
||||
git -C "${REPOS_ROOT}/${r}" reset HEAD -- "${uf}"
|
||||
done <<< "${unmerged_paths}"
|
||||
git -C "${REPOS_ROOT}/${r}" stash drop -q || true
|
||||
fi
|
||||
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
|
||||
echo " [push] Pushing ${r} to git.libre.audio..."
|
||||
fi
|
||||
run_checked "git push (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" push origin main || true
|
||||
run_checked "git push (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" push origin main
|
||||
if [[ "${PUSH_ONLY}" -eq 1 ]]; then
|
||||
echo " [ok] Repository ${r} successfully pushed to git.libre.audio."
|
||||
echo " [ok] Repository ${r} successfully pushed to git.libre.audio ($(git -C "${REPOS_ROOT}/${r}" rev-parse --short HEAD))."
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user