Skip to main content

Deploy your project automatically when git branch was updated.

Project description

Deploy your project automatically when git branch was updated via GitHub webhooks.

Usage

Install deployserver from pip.

$ pip3 install deployserver

To start your first autodeploy daemon you need to create deploy.py script file in your project.

import deployserver


deployserver.init({
    'server_address': 'http://mydomain.com',
    'port': 1234,
    'deploy': 'cd /var/www/myProject;' \
              'git pull;'
})

Then you need to run this script.

$ python3 deploy.py

If you want to run autodeploy daemon in background, use Screen.

$ screen -dmS deployserver_myProject python3 deploy.py

Screen docs: https://www.gnu.org/software/screen/manual/screen.html

Initial params

For initiation deployserver params dict is required.

server_address : string

Enter a domain name for this server with http protocol.

'server_address': 'http://mydomain.com'
'server_address': 'http://8.8.8.8'
'server_address': 'http://0a1b2c3d.ngrok.io'

port : integer

deployserver will listen this local port.

'port': 2345

deploy : string

Bash commands sequence which should be initiated on branch update.

'deploy': 'cd /var/www/myProject;' \
          'git pull;'
'deploy': '/var/www/myProject/deploy.sh'

(optional) branch : string

Which branch push event should initiate deploy function.

# default
'branch': 'master'
'branch': 'current-sprint'
'branch': 'ver2'

(optional) uri : string

Callback uri.

# default
'uri': '/callback'
'uri': '/'

(optional) secret_token : string

Secret token. Check if it is set.

# default
'secret_token': None
'secret_token': 'a96529a4af7864e7f6e11035d10b7db5'

Requirements

  • Python >= 3.5

  • aiohttp

  • asyncio

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

deployserver-0.3.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

deployserver-0.3.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file deployserver-0.3.1.tar.gz.

File metadata

File hashes

Hashes for deployserver-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b03648f560db8300132db01964708da2e0de3d1f01ede7cf197cf3371a40a187
MD5 bb7c2e811341d9a240d3092d0f99c516
BLAKE2b-256 a2a2e6e68e0d4443f3b83ef1af98ec6cff5a8c0418786e55ebd0687a97fdd6d0

See more details on using hashes here.

File details

Details for the file deployserver-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for deployserver-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71fced7b5056da2418c942743a668175108e2419f3228359e6739fdb15be512c
MD5 157ecc5ad9d87b86f11e55099db74bb3
BLAKE2b-256 73ed8a323ff34c4b37fabd4a508945f0c1bf4fab31359739e2f3802804b0a484

See more details on using hashes here.

Supported by

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