Skip to content

Commit

Permalink
Travis build should first run build, then gen docs and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Mar 7, 2017
1 parent 9cd3105 commit 9f2186d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: node_js
node_js:
- stable
script:
- bash scripts/build.sh
after_success:
- bash gendocs.sh
- bash scripts/gendocs.sh
- bash scripts/genexamples.sh
env:
global:
- ENCRYPTION_LABEL: a34ff6591ac8
3 changes: 3 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

npm run build
3 changes: 0 additions & 3 deletions gendocs.sh → scripts/gendocs.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash

#based on:
#https://hiddentao.com/archives/2016/08/29/triggering-travis-ci-build-from-another-projects-build/

body='{
"request": {
"message": "Regen docs from module update",
Expand Down
15 changes: 15 additions & 0 deletions scripts/genexamples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

body='{
"request": {
"message": "Regen examples from module update",
"branch": "master"
}}'

curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_API_TOKEN" \
-d "$body" \
https://api.travis-ci.org/repo/awayjs%2Fawayjs-examples/requests

0 comments on commit 9f2186d

Please sign in to comment.