Skip to content

fix(deploy): restore missing transfer loop in deploy.sh - #32

Merged
shennarwp merged 4 commits into
masterfrom
fix/deploy-transfer-loop
Oct 12, 2026
Merged

shennarwp merged 4 commits into
masterfrom
fix/deploy-transfer-loop

Conversation

@shennarwp

Copy link
Copy Markdown
Owner

TASK-11 (3375fee) rewrote deploy.sh to batch SSH round trips, but the actual file transfer loop was lost — the comment at line 300 was replaced with a colon (:) no-op. The deploy_remote() function built dsts/srcs/kinds arrays and ran backup/chmod/verify, but never called push() to copy files to remote hosts.

This caused every deploy since TASK-11 to report size mismatches while leaving remote files untouched. The chtw alias (removed locally in merged/.bash_aliases) persisted on all fleet hosts.

Changes:

  • restore the transfer loop iterating dsts/srcs, calling push()
  • restore push_append() for host-local content preservation (alpine/qnap)
  • escape remote-side expansions in backup_remote() ssh string: \1, , \ in comment — these were being expanded locally under set -u, causing 'n: unbound variable'

Verified:

  • zot, m9, alp all received updated .bash_aliases (4084 bytes, no chtw alias)
  • tools/validate.sh all checks pass
  • tests/deploy_matrix_test.sh all checks pass

TASK-11 (3375fee) rewrote deploy.sh to batch SSH round trips but the
actual file transfer loop was lost — the comment at line 300 was replaced
with a colon (:) no-op. The deploy_remote() function built dsts/srcs/kinds
arrays and ran backup/chmod/verify, but never called push() to copy files
to remote hosts.

This means every deploy since TASK-11 reported size mismatches but never
overwrote remote files. The chtw alias (removed locally in merged/
.bash_aliases) persisted on all fleet hosts.

Fix:
- restore the transfer loop iterating dsts/srcs, calling push()
- restore push_append() for host-local content preservation (alpine/qnap)
- escape remote-side expansions in backup_remote() ssh string: $((n + 1)),
  $(ls -dt ...), $keep in the comment — these were being expanded by the
  local shell under set -u, causing 'n: unbound variable'

All reachable hosts now receive updated merged/ content.
deploy.sh:
- Resolve remote destination using $HOME before ssh-streaming so
  paths such as ~/.bashrc expand correctly on QNAP.
- Log manifest transfer phase consistently.

merged-qnap/.bashrc:
- Show neofetch once per interactive shell when available.
- Fallback to [DEPLOY] OS/arch banner when neofetch is absent.
- Set NEOFETCH_RAN to avoid repeated display.

Verified QNAP /root/.bashrc renders fallback banner.
- Check /root/bin/neofetch first, run if available
- Fall back to /root/bin/ufetch if neofetch absent
- Use NEOFETCH_RAN and UFETCH_RAN guards to avoid double-runs
@shennarwp
shennarwp merged commit bc9fddc into master Oct 12, 2026
2 checks passed
@shennarwp
shennarwp deleted the fix/deploy-transfer-loop branch October 12, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant