-
Clone this repository to the target server
-
[Optional] Create virtual environment:
virtualenv venv
-
[Optional] Activate it:
source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Edit
example.service
and move it to your systemd folderFor example, the path for Ubuntu 18.04 is
/etc/systemd/system/deploy.service
.You should specify path to your folder and user which has both ability to read from remote repositories as well as privileges to write to projects' folders.
-
Reload systemd daemon:
systemctl daemon-reload
(as root) -
Start service:
service deploy start
(as root) -
Enable startup on boot:
systemctl enable deploy
(as root)
You should put configuration file deploy.yaml
in project folder to setup deploy configuration. Its root element is a dictionary containing these properties:
-
secret
— required — GitHub webhook secret -
bind
— required — host and port to listen onNote: Deploy System doesn't support HTTPS protocol. Use Nginx for reverse-proxying. Sample config is provided in
example.nginx.conf
. -
projects
— required — list ofProject
objects
repo
— required — full repository namebranch
— optional, defaults tomaster
— branch namepath
— required — location of the project on your drivescript
— optional — bash command to redeploy the project
Open Webhooks tab in repository or organization settings, setup new webhook. Send only push
events. By default, Deploy System listens on /
.
- If
script
is provided in configuration file, it will be started to deploy new version - Otherwise, if
deploy.sh
exists in the project root, it will be started - Otherwise, Deploy System will execute
docker-compose restart
- Implement Telegram notifications on pushes
- Send HTTP response asynchronously
- ???
- PROFIT!!!!