diff options
author | Oliver Poignant <oliver@poignant.se> | 2016-05-29 10:39:53 +0200 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2016-05-29 10:39:53 +0200 |
commit | b2f95fa7a1f12ea4b8029320db4c7458a9a32feb (patch) | |
tree | 2258bb6d704d19e0a8bd7a043781bfa4f4ae214e /docs | |
parent | 110be3c3ea3d34c5cd686061f9dda7e69222e536 (diff) | |
parent | 84e99d89e75b4c2e5e5e8678a15adb9d391daa44 (diff) | |
download | Git-Auto-Deploy-b2f95fa7a1f12ea4b8029320db4c7458a9a32feb.zip Git-Auto-Deploy-b2f95fa7a1f12ea4b8029320db4c7458a9a32feb.tar.gz Git-Auto-Deploy-b2f95fa7a1f12ea4b8029320db4c7458a9a32feb.tar.bz2 |
Merge branch 'master' into development
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Configuration.md | 34 | ||||
-rw-r--r-- | docs/Continuous Delivery via Pull requests.md | 11 | ||||
-rw-r--r-- | docs/Install as a python module.md | 1 | ||||
-rw-r--r-- | docs/Start automatically on boot.md | 2 |
4 files changed, 43 insertions, 5 deletions
diff --git a/docs/Configuration.md b/docs/Configuration.md index 953385d..3128697 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -24,6 +24,7 @@ as follow: - **pidfilepath**: The path where `pid` files are kept. - **logfilepath**: To enable logging, set this to a valid file path. + - **log-level**: Sets the threshold for the log output. Default value is NOTSET (all details). Recommended value is INFO (less details). - **host**: What IP address to listen on. - **port**: The port for the web server to listen on. - **global_deploy**: An array of two specific commands or path to scripts @@ -45,6 +46,7 @@ Repository configurations are comprised of the following elements: - **filters**: Filters to apply to the web hook events so that only the desired events result in executing the deploy actions. See section *Filters* for more details. + - **secret-token**: The secret token set for your webhook (currently only implemented for [GitHub](https://developer.github.com/webhooks/securing/) and GitLab) ## Filters *(Currently only supported for GitHub and GitLab)* @@ -70,6 +72,38 @@ A filter can use `object_kind` and `ref` attributes for example to execute the deploy action only on a `build` event on the `master` branch. # Examples + +## GitHub + +The following example will trigger when a pull request with **master** as base is closed. +```json +{ + "host": "0.0.0.0", + "port": 8080, + "global_deploy": [ + "echo Pre-deploy script", + "echo Post-deploy script" + ], + "repositories": [ + { + "url": "https://github.com/olipo186/Git-Auto-Deploy.git", + "branch": "master", + "remote": "origin", + "path": "~/repositories/Git-Auto-Deploy", + "deploy": "echo deploying", + "filters": [ + { + "action": "closed", + "pull_request": true, + "pull_request.base.ref": "master" + } + ] + } + ] +} +``` + +## GitLab *(Note: the filter examples below are valid for GitLab)* Execute pre-deploy script, don't `pull` the repository but execute a deploy diff --git a/docs/Continuous Delivery via Pull requests.md b/docs/Continuous Delivery via Pull requests.md index 41601c4..047c76c 100644 --- a/docs/Continuous Delivery via Pull requests.md +++ b/docs/Continuous Delivery via Pull requests.md @@ -10,11 +10,14 @@ You can follow next steps to implement CD process: * Configure branch in which pull request trying to merge (variable "ref" below) Example -```"url": "https://api.github.com/repos/olipo186/Git-Auto-Deploy", +```json +"url": "https://api.github.com/repos/olipo186/Git-Auto-Deploy", "deploy": "echo deploying after pull request", "filters": [ { - "type": "pull-request-filter", "action": "closed", - "ref": "testing-branch" -}] + "pull_request": true, + "pull_request.base.ref": "testing-branch" +} +] +``` diff --git a/docs/Install as a python module.md b/docs/Install as a python module.md index 8700eed..ee3f2a1 100644 --- a/docs/Install as a python module.md +++ b/docs/Install as a python module.md @@ -28,7 +28,6 @@ Copy the content of [config.json.sample](../config.json.sample) and save it anyw ## Running the application Run the application using the executable ```git-auto-deploy``` which has been provided by pip. Provide the path to your configuration file as a command line argument. - referencing the ```gitautodeploy``` module (the directory ```Git-Auto-Deploy/gitautodeploy```). git-auto-deploy --config ~/git-auto-deploy.conf.json diff --git a/docs/Start automatically on boot.md b/docs/Start automatically on boot.md index 48977a3..f0f3ffb 100644 --- a/docs/Start automatically on boot.md +++ b/docs/Start automatically on boot.md @@ -20,6 +20,8 @@ Copy the sample init script into ```/etc/init.d/``` and make it executable. **Important:** The init script assumes that you have ```Git-Auto-Deploy``` installed in ```/opt/Git-Auto-Deploy/``` and that the ```pidfilepath``` config option is set to ```/var/run/git-auto-deploy.pid```. If this is not the case, edit the ```git-auto-deploy``` init script and modify ```DAEMON```, ```PWD``` and ```PIDFILE```. +**Important:** The init script will run GAD as the ```root``` user by default, which is convenient but not secure. The recommended way to run GAD is to set up a separate user and modify the init script to run GAD as that user. When running GAD as a user other than root, you will need to make sure that the correct permissions are set on all directories and files that GAD requires access to (such as the path specified in the variable PIDFILE and LOGFIE in the init script). + Now you need to add the correct symbolic link to your specific runlevel dir to get the script executed on each start up. On Debian_Sys-V just do; update-rc.d git-auto-deploy defaults |