Skip to main content

Super Simple Auto-Deployment server

Project description

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

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.

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

pullboy-0.91.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

pullboy-0.91-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pullboy-0.91.tar.gz.

File metadata

  • Download URL: pullboy-0.91.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pullboy-0.91.tar.gz
Algorithm Hash digest
SHA256 69abf4750fc6dde6d5edb21353745351bba68162dd35e0a93bb55875c1a15a26
MD5 c90641b5ff0a90d86bbbd38f05c0438e
BLAKE2b-256 8502c28126860b90ad72aa2f9d820bf5d4d3dfe71e0e77a6317d561024f460c4

See more details on using hashes here.

File details

Details for the file pullboy-0.91-py3-none-any.whl.

File metadata

  • Download URL: pullboy-0.91-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pullboy-0.91-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa5eddd3702c0afc7c3d6bda8f56f7420460d622778dd2dc6ae1edaa7e42c83
MD5 c287b19f579187d74ed58d855dcd57b0
BLAKE2b-256 8f22539db2160cf429079f94e885119e405d054887afe45d5b9b94847a49998f

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