depush
Deploy a versioned codebase directory to S3/MinIO, SSH, or a local directory.
depush reads a version file from your codebase directory and deploys all files to {prefix}/{version}/ at the destination. Stale files at the destination that no longer exist in the source are automatically deleted, keeping deployments in sync. You can also override the version string at deploy time without touching the version file.
Configuration is flexible: use CLI flags, environment variables, or a YAML config file. Precedence (highest to lowest): CLI flag > environment variable > YAML config > default.
Installation
pip install depush
Or with uv:
uv add depush
To install as a standalone CLI tool:
uv tool install depush
Quick start
Your codebase directory must contain a version file:
my-project/
├── version # contains e.g. "1.2.3"
├── main.py
└── ...
If you supply --version-override (or DEPUSH_DEPLOY_VERSION_OVERRIDE), the version file is optional and its value is ignored.
Deploy to S3 / MinIO
depush --target s3 --prefix mylib \
--s3-bucket deployments \
--s3-endpoint http://localhost:9000 \
--s3-access-key admin \
--s3-secret-key secret
Files are uploaded to s3://deployments/mylib/1.2.3/.
Deploy over SSH
depush --target ssh --prefix mylib \
--ssh-host myserver.example.com \
--ssh-user deploy \
--ssh-key-file ~/.ssh/id_rsa
Files are copied to /deployments/mylib/1.2.3/ on the remote host.
Deploy to a local directory
depush --target local --prefix mylib --local-dest /srv/releases
Files are copied to /srv/releases/mylib/1.2.3/.
Dry run
Add --dry-run to any command to preview what would be deployed without making any changes:
depush --target s3 --prefix mylib --s3-bucket deployments --dry-run
Override the version
Pass --version-override to use a custom version string instead of reading the version file. The file does not need to exist when this flag is set:
depush --target local --prefix mylib --local-dest /srv/releases \
--version-override "$(git rev-parse --short HEAD)"
Files are deployed to /srv/releases/mylib/<git-sha>/.
Configuration file
Place a depush.yaml in the current directory (or pass --config path/to/file.yaml) to avoid repeating flags:
target: s3
prefix: mylib
codebase_dir: ./codebase
# dry_run: false
# version_override: "v1-hello" # optional; overrides the version file when set
# empty string (or omitting the key) falls back to reading the version file
s3:
bucket: deployments
endpoint: http://localhost:9000 # omit for AWS
region: us-east-1
access_key: admin
secret_key: secret
# local:
# dest: ./dist
# ssh:
# host: myserver.example.com
# port: 22
# user: deploy
# key_file: ~/.ssh/id_rsa
# deploy_root: /deployments
Environment variables
All options can also be set via environment variables:
| Variable | Description | Default |
|---|---|---|
DEPUSH_DEPLOY_TARGET |
Deployment target: s3, ssh, or local |
(required) |
DEPUSH_DEPLOY_PREFIX |
Path prefix, e.g. mylib → mylib/{version}/ |
(required) |
DEPUSH_DEPLOY_CODEBASE_DIR |
Path to codebase directory | . |
DEPUSH_DEPLOY_VERSION_OVERRIDE |
Override the deployment version; version file not required when set. An empty string is treated as unset and falls back to the version file. |
|
DEPUSH_DEPLOY_DRY_RUN |
Set to 1, true, or yes to preview |
false |
DEPUSH_DEPLOY_CONFIG |
Path to a YAML config file | depush.yaml if present |
DEPUSH_DEPLOY_LOCAL_DEST |
Root destination for local deployments | ./dist |
DEPUSH_S3_BUCKET |
S3/MinIO bucket name | (required for s3) |
DEPUSH_S3_ENDPOINT |
Custom endpoint URL for MinIO | (AWS default) |
DEPUSH_S3_REGION |
AWS region; falls back to AWS_DEFAULT_REGION |
us-east-1 |
DEPUSH_S3_PROFILE |
AWS credentials profile name (from ~/.aws/credentials); falls back to AWS_PROFILE |
|
DEPUSH_S3_ACCESS_KEY |
Access key / MinIO username; falls back to AWS_ACCESS_KEY_ID |
|
DEPUSH_S3_SECRET_KEY |
Secret key / MinIO password; falls back to AWS_SECRET_ACCESS_KEY |
|
DEPUSH_SSH_HOST |
SSH server hostname or IP | (required for ssh) |
DEPUSH_SSH_PORT |
SSH port | 22 |
DEPUSH_SSH_USER |
SSH username | admin |
DEPUSH_SSH_PASSWORD |
SSH password (omit to use key auth) | |
DEPUSH_SSH_KEY_FILE |
Path to private key file | |
DEPUSH_SSH_DEPLOY_ROOT |
Absolute path on the remote server | /deployments |
Ignoring files
Create a .depushignore file in the directory you run depush from (the same place depush.yaml is looked up) using the same syntax as .gitignore to exclude files from deployment. Patterns are matched relative to the codebase directory:
*.log
__pycache__/
.env
Programmatic use
from depush import depush
# Parse args and deploy
depush.main()
# Or use individual functions
files = depush.collect_files(Path("./my-codebase"))
Release files for depush 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| depush-0.4.2.tar.gz | 26.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| depush-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.7 kB
Release files / depush-0.4.2.tar.gz
| Download URL | depush-0.4.2.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a44f276168004ee6b7c6d230a3e78a433548512f071e0c483f768dae77220bab
|
|
BLAKE2b-256 checksum How to use checksums |
43d9867c412a48c52d65c7806cb7a965acf57fc4c62217635cd6823b1cd3653b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / depush-0.4.2-py3-none-any.whl
| Download URL | depush-0.4.2-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f30532efae0f01e96704e88cf6aa5aaca5d3ff87ace68d56b2558999cb3e7c47
|
|
BLAKE2b-256 checksum How to use checksums |
1d8f3872d4dc22a0b63d878fc59622c733e65108d61a3552f8faa5bb1c133bdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|