You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user/triggering-builds.md
+49-2Lines changed: 49 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ title: Triggering builds with API V3
4
4
layout: en
5
5
---
6
6
7
+
## Travis CI Hosted Solution (app.travis-ci.com)
8
+
7
9
Trigger Travis CI builds using the API V3 by sending a POST request to `/repo/{slug|id}/requests`:
8
10
9
11
1. Get an API token from your Travis CI [settings page](https://app.travis-ci.com/account/preferences). You'll need the token to authenticate most of these API requests.
@@ -12,7 +14,7 @@ Trigger Travis CI builds using the API V3 by sending a POST request to `/repo/{s
@@ -23,7 +25,7 @@ Trigger Travis CI builds using the API V3 by sending a POST request to `/repo/{s
23
25
```bash
24
26
body='{
25
27
"request": {
26
-
"branch":"master"
28
+
"branch":"master",
27
29
"sha":"bf944c952724dd2f00ff0c466a5e217d10f73bea"
28
30
}}'
29
31
@@ -117,6 +119,51 @@ Trigger Travis CI builds using the API V3 by sending a POST request to `/repo/{s
117
119
118
120
{{ site.data.snippets.ghlimit }}
119
121
122
+
## Travis CI Enterprise
123
+
124
+
Trigger Travis CI builds using the API on your Travis CI Enterprise instance by sending a POST request to `/repo/{slug|id}/requests`:
125
+
126
+
1. Get an API token from your Travis CI Enterprise at https://PLATFORM_URL/account/preferences. You'll need the token to authenticate most of these API requests.
127
+
128
+
You can also use the Travis CI [command line client](https://github.com/travis-ci/travis.rb#travis-ci-and-travis-ci-enterprise)
129
+
to get your API token:
130
+
131
+
```
132
+
travis login -X --github-token YOUR_GITHUB_TOKEN
133
+
travis token -X
134
+
```
135
+
136
+
2. Send a request to the API. This example shell script sends a POST request to
137
+
`/repo/travis-ci/tcie-demo/requests` to trigger a build of a specific
138
+
commit (omit `sha` for most recent) of the master branch of the `travis-ci/tcie-demo` repository:
0 commit comments