Skip to content

Commit

Permalink
Travis build configured to automatically publish to Github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelcharman committed Apr 23, 2016
1 parent 1e8245f commit 7a5a494
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start

language: java
jdk:
- oraclejdk8
- oraclejdk8
- oraclejdk7
env:
global:
- secure: Aks/9RTuubSZSP5N3Do7uldJk5tpYLcq4atTzhClhV3LkphFzeOhE5WnL1CrwVhSx8wk8LQi6VQcmSt0ayjH1Vi7oABmfWv7YfI6wUaHBmCnb/vTE/ixoxVi5Px3QlOOaKj/xdmgHq/TV97PmGQ4bFU95uBpA+6sQfvf7qw3wLE=
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
after_success:
- ".utility/push-output-to-ghpages.sh"
25 changes: 25 additions & 0 deletions .utility/push-output-to-ghpages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

REPO=concordion/concordion-storyboard-extension-demo

if [ "$TRAVIS_REPO_SLUG" == "$REPO" ] && [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then

echo -e "Publishing output...\n"

cp -R build/reports/spec $HOME/spec-latest

cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "travis-ci"
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/$REPO gh-pages > /dev/null

cd gh-pages
git rm -rf ./spec
cp -Rf $HOME/spec-latest ./spec
git add -f .
git commit -m "Latest output on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages"
git push -fq origin gh-pages > /dev/null

echo -e "Published output to gh-pages.\n"

fi

0 comments on commit 7a5a494

Please sign in to comment.