
Capistrano-style Python deployment

Capistrano-style Python deployment
Pystrano is an open source deployment automation tool designed specifically for Django and FastAPI applications. It facilitates Capistrano style deployments by allowing developers to define repeatable, SSH based workflows using YAML playbooks. The tool serves as a bridge between manual shell commands and complex orchestration platforms, automating the process of preparing servers, creating timestamped releases, and managing application services on VPS style environments. The tool operates by organizing deployment configurations into specific directory structures based on the application and environment. Its core functionality includes the ability to clone code, install dependencies using pip or uv, and execute framework specific tasks. Pystrano manages the lifecycle of a release by creating unique directories for each deployment and promoting the active version through a current symlink. It also includes automated pruning of older releases to manage server space and provides a preview feature to inspect remote commands before execution. The typical workflow begins with the initialization of a configuration, which generates deployment settings and starter systemd service files. Users then run a setup command to prepare the remote server, which includes creating the deploy user, establishing directories, managing known hosts, and configuring the virtual environment. Once the environment is prepared, the deployment command handles the transfer of code and the restarting of systemd services. Technical requirements for using Pystrano include existing SSH access to a target server and a defined file path for the application. The tool is designed to work with systemd for service management and relies on YAML files for configuration. While it manages the promotion of new releases, it currently does not expose a dedicated rollback command through its CLI. The project is community maintained and focuses on providing a structured approach to Python web deployments.