How do SFTP deployments work?
First, DeployBot offers two kinds of SFTP deployments: file deployments and atomic deployments. File deployments upload files directly to the directory that you specify. They iterate over changes since the last deployed Git commit in lexicographical order removing or uploading files one-by-one like an FTP/SFTP client would.
What gets changed?
What is the order of events?
How exactly do atomic deployments work?
- releases — contains cached copies of your releases including the currently active release.
- deploy-cache — contains the last uploaded state. Manually modifying this directory will break your deployments.
- shared — contains your shared resources: user-uploaded content, file caches, etc.
- current — a symbolic link to the currently active release from the releases directory.
- DeployBot makes sure all the directories mentioned above exist and creates the missing ones.
- DeployBot updates the copy of your code in a cache directory on your server.
- When the code is updated, DeployBot copies that code to a separate release directory.
- In the release directory, DeployBot executes user-specified post-upload commands to get code into shape — like installing application dependencies or linking shared resources.
- Once the release is ready, the current symlink is updated to point to a new release directory.
- User-defined commands are then executed to restart your application server, prune caches, or notify external services.
- DeployBot removes previous versions of your apps from the releases directory, keeping only a fixed number of newest ones. This number is configurable via advanced server settings.
Please note: We don’t support SFTP deployments to Windows hosts.