Skip to main content

Deploy your project automatically when git branch was updated.

Project description

Deploy your project automatically when git branch was updated.

Usage

To start your first autodeploy daemon you need to create python script file for your project.

# Import DeployServer class
from DeployServer import DeployServer


# Init DeployServer with params
DeployServer({
    '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': '/'

Dependences

Make sure that you have installed following packages. * aiohttp * asyncio

You can install all package dependences by entering this command:

$ pip3 install -r requirements.txt

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.1.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for deployserver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e71b4fb8dd9d912938cab23410889bb8a4f96ae9a9f7d9ed325059acaa0534a2
MD5 09cfd58f2bac95ec03875337ebafa24e
BLAKE2b-256 3b30bbda14f74707fc3315af75362df3318f3aabe1e86abbba1b9888921228b5

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