Skip to content

Commit

Permalink
enabling travis builds
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Apr 25, 2018
1 parent 3837f8b commit 86e6574
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .travis.yml
@@ -1,22 +1,31 @@
language: node_js
- "8.9.0"

install:
- npm install -g gitbook-cli
- gitbook install
- sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"

script:
- gitbook build
- gitbook pdf ./ _book/teiid-documents.pdf
- gitbook build ./ content
- gitbook pdf ./ teiid-documents.pdf

after_success: |
if [ -n "$GITHUB_API_KEY" ]; then
git checkout --orphan gh-pages
git checkout --orphan $TRAVIS_BRANCH-gh-pages
git rm -rf .
rm -rf $TRAVIS_BRANCH
mv _book $TRAVIS_BRANCH
git add -f --ignore-errors --all $TRAVIS_BRANCH
git add -f --ignore-errors --all content teiid-documents.pdf
git -c user.name='travis' -c user.email='travis' commit -m 'ci publishing'
git push -f -q https://$GITHUB_USER:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG gh-pages
git push -f -q https://$GITHUB_USER:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG $TRAVIS_BRANCH-gh-pages
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" 1>/dev/null
git fetch origin gh-pages
git checkout gh-pages
if [ ! -d "$TRAVIS_BRANCH" ]; then
git submodule add -b $TRAVIS_BRANCH-gh-pages https://github.com/$TRAVIS_REPO_SLUG $TRAVIS_BRANCH
git -c user.name='travis' -c user.email='travis' commit -am "adding submodule"
git push -q https://$GITHUB_USER:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG gh-pages
fi
git submodule update --remote
git -c user.name='travis' -c user.email='travis' commit -am "updating submodules"
git push -q https://$GITHUB_USER:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG gh-pages
fi

0 comments on commit 86e6574

Please sign in to comment.