PullBoy
Pullboy is a VERY simple server that listens for incoming connections and deploys projects according to a predefined script.
Steps
First we install pullboy. pip install pullboy or the preferred one pipenv install pullboy. Second we write the deploy config file. An example would be:
pullboy:
workdir: '~/pullboy'
script:
- git pull origin master
- make
token: 'thisisnosecret'
active: true # This is optional. Default is assumed to be true
For Gitlab you can add push events in the webhooks and pullboy will take care of auto deploy for you. Here we don't really need a project name so we can have a config like so:
a_token_for_gitlab_to_identify_the_script:
workdir: '~/pullboy'
script:
- git pull origin master
- make
active: true
branch: master
gitlab: true
See config.yml for a full example.
We can now add a gitlab webhook which has the secret token as a_token_for_gitlab_to_identify_the_script. That's all there is to it. Now whenever someone pushes to the repo and it's the master branch. the script will be executed.
Now we run pullboy with the following command pullboy config.yaml.
That's it.
Notes
To make pullboy deploy something all you need to do is hit https://wherever.pullboy.is.running.com:8764/deploy with the items project and token in the POST body. For this activity HTTPS is recommended.
Tokens are meant to be kept a secret otherwise anyone with access to this URL can deploy the code (we don't want it to be that simple do we?). An example cURL command to deploy the project shown in the config above would be:
curl -X POST -F project=pullboy -F token=thisisnosecret https://wherever.pullboy.is.running.com:8764/deploy
curl -X POST -F project=pullboy -F token=thisisnosecret https://wherever.pullboy.is.running.com:8764/pullboy/deploy
curl -X POST -F project=pullboy -F token=thisisnosecret https://wherever.pullboy.is.running.com:8764/pullboy/deploy/user
curl -X POST -F project=pullboy -F token=thisisnosecret https://wherever.pullboy.is.running.com:8764/pullboy/deploy/ci
curl -X POST -F project=pullboy -F token=thisisnosecret https://wherever.pullboy.is.running.com:8764/pullboy/deploy/bossman
The url does not matter, whatever URL you access, pullboy will be ready to work. This makes it easy to use with a reverse proxy like Nginx where you can forward a url like /pullboy/deployments/ci and /pullboy/deployments/manual to Pullboy. The Nginx logs can act as logs for deployments.
Let's Encrypt is the recommended way to obtain HTTPS but in case you are using your laptop for something, ngrok is a neat way to get HTTPS.
Metadata
Release files for pullboy 0.94
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pullboy-0.94.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pullboy-0.94-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / pullboy-0.94.tar.gz
| Download URL | pullboy-0.94.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
015b71a15de1b78303e1446dccfc1aedc8c3894367c10d4aea96ad7ce780cc7b
|
|
BLAKE2b-256 checksum How to use checksums |
a85f0fe9403968de64224263516bc9a60830092519a322f88b3d040b0e6e4b05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.22.0 CPython/3.6.2
|
Release files / pullboy-0.94-py3-none-any.whl
| Download URL | pullboy-0.94-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
caf5badb46458b8fb4b4850a5553e642081ee264cfef09a8be846e7aee559fb1
|
|
BLAKE2b-256 checksum How to use checksums |
d4f760acf38a4095111c8cdb1c16b5f169d5e125cad6a3c501acda4e5c1c968c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.22.0 CPython/3.6.2
|