v2.0.0 — multi-branch deployment and ssh remote script execution
What's New in v2.0.0 🚀
This is a major release that transforms local-git-deploy from a simple file sync tool into a lightweight, powerful deployment pipeline for FTP and SFTP servers.
🌟 Major Features
- Multi-Branch Deployment: You can now configure different servers and directories for different branches in a single
local-git-deploy.ymlfile! It supports exact branch names (likemainandstaging) and glob patterns (likefeature/*). - Per-Branch Credentials: Use the new
password_envconfig key to securely map different branches to different environment variables (e.g.,DEPLOY_PASSWORD_PROD,DEPLOY_PASSWORD_STAGING) loaded from your.envfile. - Remote SSH Hooks (SFTP Only): Automate your post-deploy tasks! You can now define
pre_deployandpost_deploycommands in your config to run database migrations, clear caches, or put your site in maintenance mode directly on the server over SSH. Supports both inline commands and script files.
✨ Enhancements
- Added a
--branchflag to manually override branch detection (perfect for CI/CD environments). - Added a
--forceflag to deploy unmapped branches using base default configurations. - State tracking is now completely branch-isolated. Deploying to
staginggenerates a.deploy-sync-state-stagingfile, meaning you'll never accidentally corrupt yourmainbranch's deployment state. - Enhanced error handling and input validation across the board.
📝 Documentation Updates
- The
README.mdhas been completely rewritten with extensive examples of the new multi-branch and SSH hook features, plus a new "Use Cases" section. - Updated the sample
local-git-deploy.sample.ymlto showcase advanced setups.
Note: Existing flat configurations will continue to work perfectly without any modifications. The new
branches:configuration block is entirely opt-in!