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

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.

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.94.tar.gz (3.7 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.94-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pullboy-0.94.tar.gz
  • Upload date:
  • Size: 3.7 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.94.tar.gz
Algorithm Hash digest
SHA256 015b71a15de1b78303e1446dccfc1aedc8c3894367c10d4aea96ad7ce780cc7b
MD5 540729f2cc8d6f1cc59155387937f8c6
BLAKE2b-256 a85f0fe9403968de64224263516bc9a60830092519a322f88b3d040b0e6e4b05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pullboy-0.94-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.94-py3-none-any.whl
Algorithm Hash digest
SHA256 caf5badb46458b8fb4b4850a5553e642081ee264cfef09a8be846e7aee559fb1
MD5 ef1693fd1015d7b36e335ec19beb2de3
BLAKE2b-256 d4f760acf38a4095111c8cdb1c16b5f169d5e125cad6a3c501acda4e5c1c968c

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