Skip to main content

A Python package for managing deploying Django applications (like Capistrano for Ruby)

Project description

Pystrano

Pystrano is a simple deployment tool for Python projects. It is inspired by Capistrano, a popular deployment tool for Ruby projects.

Disclaimer

This is a work in progress. It is not ready for production use just yet. Proceed with caution. Currently used with Ubuntu by yours truly. If someone finds it useful and wants to use it in any capacity, don't hesitate.

Installation

pip install pystrano

Usage

Pystrano is a command line tool. To deploy a project, you need to create a config for the environment you want to deploy to.

Configuration

Pystrano uses a YAML file to configure the deployment. It contains two sections: common and servers. Variables in common section are shared across all servers, while in servers section you define a list of servers to deploy to. It is also possible to define server-specific variables, which will override the common ones (if defined).

Here is a description of variables you can set in the config file:

  • source_code_url: The URL of the git repository;
  • project_root: The directory where the project is located;
  • project_user: The user that will be used to deploy the project;
  • venv_dir: The directory where the virtual environment is located (in the project_user home);
  • keep_releases: The number of releases to keep on the server. If set to 0 or less, all releases will be kept;
  • system_packages: A list of system packages to install on the server (during setup);
  • env_file: The path to the environment file to use for the deployment;
  • ssh_known_hosts: The path to the known hosts file to use for the deployment (during setup; separated by semicolons);
  • service_file: The path to the service file to set up/use in deployment (optional);
  • secrets: List of secrets to set up on the server (during setup only for now; separated by semicolons);
  • branch: The name of the branch to deploy.

Server-specific variables:

  • host: The hostname of the server;
  • port: The port to use for SSH connection (optional, default is 22);
  • run_migrations: Whether to run migrations on deployment (optional, default is false);
  • run_collectstatic: Whether to run collectstatic on deployment (optional, default is false);

Deployment

To set up deployment for a project, run the following command:

pystrano-setup --config-file=path/to/config.yml

This will set up your server to be ready for deployment.

To deploy your project, run the following command:

pystrano --config-file=path/to/config.yml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystrano-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystrano-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file pystrano-1.0.0.tar.gz.

File metadata

  • Download URL: pystrano-1.0.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pystrano-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c0051883a1d759bd784fab1125f01ac09906cbc72908ed36179a2efee25552b4
MD5 e09bc338ee737de93cec79056ad48214
BLAKE2b-256 87ffcd6fb2ab95076dc5ffed0079e820a29820c6d47c818dc0c0a701023dc2f5

See more details on using hashes here.

File details

Details for the file pystrano-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pystrano-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pystrano-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f8ce41878c4671cc368ce311d51e19c14f16cfd7cefef190a42ed76a76f5cd4
MD5 bb11da6ccf668f4694cfe237b5b3660c
BLAKE2b-256 c65d2bbd0f5a465705045632f2a62080cf6ae8a0e703ed415519d011290f71da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page