Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

v0.2.7

Latest

Choose a tag to compare

@mi-skam mi-skam released this 15 Dec 02:37
230cfc2

What's New

Skip tarball transfer when remote already has matching hash

Optimizes deployments by comparing SHA256 hashes before transferring large tarballs:

  • Hash computation: After saving a tarball, computes and stores SHA256 hash in dist/*.tar.gz.sha256
  • Remote check: Before transfer, checks if remote /tmp/ already has a tarball with matching hash via SSH
  • Smart skip: Skips tarball transfer if hashes match (template and env files still transferred)
  • Validation: Validates hash format (64 hex chars) and handles SSH failures gracefully
  • Cleanup: Hash files are cleaned up alongside old tarballs

Test suite

Added pytest test suite with 12 tests covering the hash comparison feature.

Files Changed

  • src/deploy_kit/docker.py - Hash computation and storage
  • src/deploy_kit/backends/compose.py - Remote hash check logic
  • src/deploy_kit/scripts/ssh_check_hash.sh - New script for remote hash retrieval
  • src/deploy_kit/scripts/ssh_transfer.sh - Conditional tarball transfer
  • src/deploy_kit/scripts/__init__.py - Added run_script_capture() helper
  • tests/test_hash_transfer.py - New test suite