#!/bin/bash
set -e
./grailsw refresh-dependencies --non-interactive
./grailsw test-app --non-interactive
./grailsw package-plugin --non-interactive
./grailsw doc --pdf --non-interactive
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_REPO_SLUG == 'candrews/grails-jcaptcha-plugin' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
  git config --global user.name "$GIT_NAME"
  git config --global user.email "$GIT_EMAIL"
  git config --global credential.helper "store --file=~/.git-credentials"
  echo "https://$GH_TOKEN:@github.com" > ~/.git-credentials
  git clone https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git -b gh-pages gh-pages --single-branch > /dev/null
  cd gh-pages
  git rm -rf .
  cp -r ../target/docs/. ./
  git add *
  git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
  git push origin HEAD
  cd ..
  rm -rf gh-pages
  ./grailsw publish-plugin --no-scm --allow-overwrite --non-interactive
else
  echo "Not on master branch, so not publishing"
fi

#!/bin/bash
set -e
./grailsw refresh-dependencies --non-interactive --stacktrace
./grailsw test-app --non-interactive --stacktrace
./grailsw package-plugin --non-interactive --stacktrace
./grailsw doc --pdf --non-interactive --stacktrace
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_REPO_SLUG == 'candrews/grails-jcaptcha-plugin' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
  git config --global user.name "$GIT_NAME"
  git config --global user.email "$GIT_EMAIL"
  git config --global credential.helper "store --file=~/.git-credentials"
  echo "https://$GH_TOKEN:@github.com" > ~/.git-credentials
  git clone https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git -b gh-pages gh-pages --single-branch > /dev/null
  cd gh-pages
  git rm -rf .
  cp -r ../target/docs/. ./
  git add *
  git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
  git push origin HEAD
  cd ..
  rm -rf gh-pages
  ./grailsw publish-plugin --no-scm --allow-overwrite --non-interactive --stacktrace
else
  echo "Not on master branch, so not publishing"
fi

Add --stacktrace to the grailsw commands
Add  --stacktrace to the grailsw commands
