Skip to content

Instantly share code, notes, and snippets.

@gastonprieto
Created May 7, 2017 17:37
Show Gist options
  • Save gastonprieto/aa0c2162eebd8c6d941e050f7229e9bc to your computer and use it in GitHub Desktop.
Save gastonprieto/aa0c2162eebd8c6d941e050f7229e9bc to your computer and use it in GitHub Desktop.
github-coverage-report.sh
#!/bin/bash
if [ "$TRAVIS_BRANCH" == "master" ]; then
echo -e "Publishing coverage..."
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG gh-pages > /dev/null
cd gh-pages
git rm -rf *
cp -Rf $TRAVIS_BUILD_DIR/target/site/jacoco/{.,}* .
touch .nojekyll
git add -f .
git commit -m "Latest cobertura report on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages"
git push -fq origin gh-pages > /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment