Remote deployment using Fabric
Project description
tideploy: remote deployment simplified
tideploy
is a simple tool to simplify remote deployment using SSH. While it has been specifically designed for deploying Docker containers, it can be easily configured for other deployment pipelines.
tideploy
is a Python CLI script that depends on Fabric, a library for executing shell commands remotely over SSH.
What tideploy
can do
tideploy
performs the following steps:
- Connects to a remote host via SSH
- Transfers files to a remote host
- Runs a script contained in the files called
deploy.sh
These are all very simple, but due to the versatile nature of steps 2 and 3 you can perform nearly any task. An example deployment can be found in /example_deployments
. There, the deploy script as well as a docker-compose file and .env file are transferred, after which Docker Compose is executed from the script.
Installation and basic usage
pip install tideploy
tideploy
is a CLI script that requires a number of arguments to function. To easily employ tideploy
in a virtualenv, Poetry is recommended. Once installed, you can view the tideploy
help by running:
poetry run tideploy --help
tideploy
does not support password-authenticated SSH connections for security reasons. Use an SSH keyfile instead. If the keyfile is protected by a passphrase, you will be prompted to enter it.
By default, tideploy
will look for a /deployment
folder in the working directory and transfer its contents to a /deployment
folder in the remote server's home directory. Subsequently, the deploy.sh
script (which is assumed to be part of the files that are transferred) is executed.
The 'hostname' and 'user' arguments are required.
tideploy -n bar.com -u foo
will connect to user foo at host bar.com, with the SSH key located at ./keys/ssh.key
.
Usage guide
usage: tideploy [-h] [-y YAML] -n HOST -u USER [-p PORT] [-k KEY] [-svn SVN_URL] [-s SOURCE]
[-t TARGET]
Deploy app remotely using Python Fabric.
Examples:
tideploy -n bar.com -u foo -s bar_deployment -t bar_target
tideploy --yaml deployments/foo_deployment.yml
tideploy -n bar.com -u foo -svn https://github.com/foo/bar/trunk/baz
optional arguments:
-h, --help show this help message and exit
-y YAML, --yaml YAML YAML configuration file location. Optional and can be used only
instead of CLI arguments. (default: ./deployments/deployment.yml)
arguments:
-n HOST, --host HOST Remote server hostname
-u USER, --user USER Remote server user
-p PORT, --port PORT Remote SSH port (default: 22)
-k KEY, --key KEY SSH key location for remote access (default: ./keys/ssh.key)
-svn SVN_URL, --svn-url SVN_URL
If files are not stored locally, you can use an SVN (Subversion)
URL to check out a specific directory that will be transferred.
Specify the local download location using the --source argument.
SVN must be installed for this to work.
-s SOURCE, --source SOURCE
Directory (relative to the script or absolute path) that contains
the deployment files (.env, docker-compose.yml and tideploy.sh).
'tideploy.sh' is required! Every file in the directory (including
in subdirectories) will be
transferred. Note that this is the directory download destination
for SVN checkout if an SVN link was provided for '--svn-url'.
(default: ./deployments/deployment)
-t TARGET, --target TARGET
Target directory in the remote server where all files from the
subdirectory will be loaded into. This must be an absolute path or
relative to the target server home directory. (default: ./deployment)
YAML configuration file
If you do not want to specify all arguments from the command line, you can supply it with a YAML file instead by denoting the file name after the --yaml
flag. All other flags are then ignored and only the YAML file is read. See the example_deployments/deploynent.yml
file for the syntax.
SVN link
If you want to be sure you are sending the most recent deployment files or you do not want to download them first, you can use a SVN (Subversion) link to check them out locally before sending them. Use the --svn-url
option. You can check out a single directory from all GitHub repositories this way (GitHub Docs).
For example, if you want to transfer the contents of the /baz
directory from the HEAD branch of the foo/bar
GitHub repository, you can use https://github.com/foo/bar/trunk/baz
. If you want it from some other branch, replace trunk
with branches/<branch>
.
Supported platforms
tideploy
depends on Fabric, which itself depends on Paramiko, which relies on a number of non-pure Python packages (bcrypt, cryptography and PyNaCl, the latter of which relies on cffi). This requirement means only platforms for which these packages have binary releases are supported, but that should include almost all.
tideploy
is primarily targeted at Linux → Linux deployment pipelines. Windows and macOS are untested.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tideploy-0.1.1.tar.gz
.
File metadata
- Download URL: tideploy-0.1.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.9 CPython/3.9.5 Linux/5.13.0-7614-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 076457418b2129d89cb722c64da1e1813b2e715fdf7d0b43bd40c4d9db8bd546 |
|
MD5 | 26853f26842f0c04ce33ae251dbc03d3 |
|
BLAKE2b-256 | 2b47ac5cd9d55f8f9818badb4c95f7f9edb5a40928ed0f049106300b5187f66e |
File details
Details for the file tideploy-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: tideploy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.9 CPython/3.9.5 Linux/5.13.0-7614-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cb0fa52785f76cc419377b44fd0d17dabc8471ba359c073fb51062a3a0d0f64 |
|
MD5 | cd4ed53cbfd99f54763f9a2ee3b21fb7 |
|
BLAKE2b-256 | bae242a65e1623f86b4b1ddcb0f4ebf0e4e8f78871985bd5b377720fdf913af0 |