#No language required so just use ruby to avoid warnings in travis yml linter
language: ruby
dist: trusty
sudo: required

cache:
  directories:
    - node_modules # NPM packages

before_install:
  - sudo apt-get -qq update
    #calibre required for gitbook pdf
  - sudo apt-get install -y calibre

install:
  - . $HOME/.nvm/nvm.sh
  - nvm install stable
  - nvm use stable
  - npm install
  - npm install -g gitbook-cli

script:
  - gitbook install
  - gitbook build
#    - gitbook pdf ./ ./stroom-docs.pdf
  - git fetch origin gh-pages:gh-pages
  - git worktree add build gh-pages
  - rsync -ar --delete --exclude '.git' ./_book/ ./build/
  - pushd build
# TODO add, commit and push to git
  - popd

# TODO release the pdf to a release tag, e.g. 'latest', updating the artifact

#No language required so just use ruby to avoid warnings in travis yml linter
language: ruby
dist: trusty
sudo: required

cache:
  directories:
    - node_modules # NPM packages

before_install:
  - sudo apt-get -qq update
    #calibre required for gitbook pdf
  - sudo apt-get install -y calibre

install:
  - . $HOME/.nvm/nvm.sh
  - nvm install stable
  - nvm use stable
  - npm install
  - npm install -g gitbook-cli

script:
  - gitbook install
  - gitbook build
#    - gitbook pdf ./ ./stroom-docs.pdf
  - git fetch origin gh-pages:gh-pages
  - git worktree add build gh-pages
  - rsync -ar --delete --exclude '.git' ./_book/ ./build/
  - pushd build
  - ls -l
# TODO add, commit and push to git
  - popd

# TODO release the pdf to a release tag, e.g. 'latest', updating the artifact

Add ls command for debugging
Add ls command for debugging
