@envsync-cloud/deploy-cli
v0.6.27
Published
CLI for self-hosted EnvSync deployment on Docker Swarm
Maintainers
Readme
@envsync-cloud/deploy-cli
Deploy EnvSync self-hosted on a single Docker Swarm host. This CLI is for operators, not local app development.
🚀 Quick Start
Prepare the host:
npx @envsync-cloud/deploy-cli preinstallWrite /etc/envsync/deploy.yaml:
npx @envsync-cloud/deploy-cli setupBootstrap the managed infra:
npx @envsync-cloud/deploy-cli bootstrapDeploy the pinned release:
npx @envsync-cloud/deploy-cli deployRunning envsync-deploy with no subcommand shows the current operator status and the recommended next command.
🧭 What This CLI Does
- writes and normalizes the self-host deploy config
- renders the Swarm stack, Traefik, Keycloak, and runtime artifacts
- bootstraps generated secrets and self-host observability state
- deploys the inactive API slot first, then promotes traffic
- keeps the previous API slot available for rollback
- creates and restores full self-host backup archives
📦 Commands
preinstallprepares Docker, Swarm, and required host packages.setupwrites the desired self-host config.bootstrapdestructively rebuilds managed infra and bootstrap state.deploydeploys the configured release.promote [blue|green]switches API traffic to a slot without rebuilding.rollbackswitches traffic back to the previously active API slot.health --jsonprints health JSON; plainhealthprints the operator summary view.upgrade [version]pins a release target and deploys it.upgrade-depsrefreshes dependency image pins and redeploys.backupcreates a managed self-host backup archive.restore <archive>restores a backup archive into the managed roots.
🔄 Upgrade Flow
upgrade now updates the pinned release target automatically. Without a version argument it uses the running deploy-cli package version.
bunx @envsync-cloud/[email protected] upgrade
bunx @envsync-cloud/[email protected] upgrade 0.6.25Blue/green keeps the previous API slot around for rollback after promotion.
🛟 Rollback / Backup
Create a backup before upgrades:
npx @envsync-cloud/deploy-cli backupRestore from an archive:
npx @envsync-cloud/deploy-cli restore /path/to/envsync-backup.tar.gzRestore and start services immediately:
npx @envsync-cloud/deploy-cli restore /path/to/envsync-backup.tar.gz --deployManual traffic control:
npx @envsync-cloud/deploy-cli promote
npx @envsync-cloud/deploy-cli rollback🧪 Local Smoke
Validate unpublished deploy-cli changes from the monorepo:
bun run selfhost:smokeImportant Notes
- Self-hosted releases use exact semver values, not
stableorlatest. bootstrapis destructive.upgradeanddeployreconcile managed versioned artifacts fromrelease.version.- Custom image overrides are still preserved for advanced self-host setups.
- The full deployment guide lives in SELFHOSTING.md.
