-
Notifications
You must be signed in to change notification settings - Fork 47
/
.travis.yml
31 lines (29 loc) · 1.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
language: generic
branches:
only:
- develop
install: gem install travis --no-rdoc --no-ri
script: >
if [ ! -z $GITHUB_TRAVIS_TOKEN ]; then
echo "Start requesting a travis build from upstream repository...";
# Doesn't use --debug on `travis login`. --debug will show the github token
travis login --skip-completion-check --org --github-token "$GITHUB_TRAVIS_TOKEN";
export TRAVIS_ACCESS_TOKEN=`cat ~/.travis/config.yml | grep access_token | sed 's/ *access_token: *//'`;
UPSTREAM_REPO_SLUG="OpenLiberty%2Fopenliberty.io"
body='{
"request": {
"message": "Build request: OpenLiberty/docs",
"branch": "multiPane"
}}'
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_ACCESS_TOKEN" \
-d "$body" \
https://api.travis-ci.org/repo/$UPSTREAM_REPO_SLUG/requests
echo "SUCCESS: Completed request for travis build from upstream repository...";
else
echo "ERROR: Missing token. Cannot request a travis build for upstream repository...";
fi
sudo: false # route your build to the container-based infrastructure for a faster build