-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
38 lines (31 loc) · 1.21 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
32
33
34
35
36
37
38
language: ruby
rvm:
- 2.4.1
branches:
only:
- dev
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="kinueng%2Fopenliberty.io"
body='{
"request": {
"message": "Build request: iguides-common",
"branch":"development"
}}'
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