Last active
August 29, 2015 14:10
-
-
Save cchacin/0f3f48bfee4a3ca21a10 to your computer and use it in GitHub Desktop.
Script to update gh-pages with maven reports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then | |
echo -e "Starting to update gh-pages\n" | |
#copy data we're interested in to other place | |
#mkdir -p $HOME/reports | |
cp -R ./target/site $HOME/. | |
#go to home and setup git | |
cd $HOME | |
git config --global user.email "travis@travis-ci.org" | |
git config --global user.name "Travis" | |
#using token clone gh-pages branch | |
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/cchacin/cucumber-common-steps.git gh-pages > /dev/null | |
#go into diractory and copy data we're interested in to that directory | |
cd gh-pages | |
cp -Rf $HOME/site . | |
touch .nojekyll | |
#add, commit and push files | |
git add -f . | |
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages" | |
git push -fq origin gh-pages > /dev/null | |
echo -e "Done magic with reporting\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment