summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDmitry Poray <dmip@interprogma.ru>2016-11-07 20:11:54 +0300
committerDmitry Poray <dmip@interprogma.ru>2016-11-15 17:19:33 +0300
commitff8194e0ec16092419862011d7cc048baa149c42 (patch)
treeeaaf61f02c9c2d59719a3a941463a9ed2a0565f3 /doc
parentc5e147de1288130147ec0f500bea50353d441cb8 (diff)
downloadgitlab-ce-ff8194e0ec16092419862011d7cc048baa149c42.tar.gz
Add ref parameter for triggerring builds with gitlab webhook from other project.
Diffstat (limited to 'doc')
-rw-r--r--doc/ci/triggers/README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/ci/triggers/README.md b/doc/ci/triggers/README.md
index 84048f1d25f..cf7c55f75f2 100644
--- a/doc/ci/triggers/README.md
+++ b/doc/ci/triggers/README.md
@@ -58,6 +58,22 @@ below.
See the [Examples](#examples) section for more details on how to actually
trigger a rebuild.
+## Trigger a build from webhook
+
+> Introduced in GitLab 8.14.
+
+To trigger a build from webhook of another project you need to add the following
+webhook url for Push and Tag push events:
+
+```
+https://gitlab.example.com/api/v3/projects/:id/ref/:ref/trigger/builds?token=TOKEN
+```
+
+> **Note**:
+- `ref` should be passed as part of url in order to take precedence over `ref`
+ from webhook body that designates the branchref that fired the trigger in the source repository.
+- `ref` should be url encoded if contains slashes.
+
## Pass build variables to a trigger
You can pass any number of arbitrary variables in the trigger API call and they
@@ -169,6 +185,14 @@ curl --request POST \
https://gitlab.example.com/api/v3/projects/9/trigger/builds
```
+### Using webhook to trigger builds
+
+You can add the following webhook to another project in order to trigger a build:
+
+```
+https://gitlab.example.com/api/v3/projects/9/ref/master/trigger/builds?token=TOKEN&variables[UPLOAD_TO_S3]=true
+```
+
### Using cron to trigger nightly builds
Whether you craft a script or just run cURL directly, you can trigger builds