Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Commit

Permalink
Configuring travis to upload wikies on gh-pages branch, #51
Browse files Browse the repository at this point in the history
  • Loading branch information
pylover committed Apr 24, 2018
1 parent 71f897a commit d2a5ba7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ install: ./scripts/travis-install.sh
script: coverage run --source wolf $(which nosetests)
after_success:
- coveralls
- if [[ $TRAVIS_BRANCH == 'master' ]] || [[ $TRAVIS_BRANCH == 'nightly' ]]; then ./scripts/travis-upload-wiki.sh ; fi
- if [[ $TRAVIS_BRANCH == 'master' ]]; then ./scripts/travis-upload-wiki.sh ; fi
- if [[ $TRAVIS_BRANCH == 'nightly' ]]; then ./scripts/travis-upload-wiki.sh nightly ; fi
12 changes: 8 additions & 4 deletions scripts/travis-upload-wiki.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ set -e # Exit with nonzero exit code if anything fails
# Save some useful information
REPO_URL=`git config remote.origin.url`
SHA=`git rev-parse --verify HEAD`
VERSION=`grep -P '^__version__ =' wolf/__init__.py | grep -oP \
'([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*))?'`
VERSION="v${VERSION}"
if [ -z "$1" ]; then
VERSION=`grep -P '^__version__ =' wolf/__init__.py | grep -oP \
'([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*))?'`
VERSION="v${VERSION}"
else
VERSION=$1
fi
TARGET="../project-gh-pages/$VERSION"
# Clone/checkout the gh-pages branch from Github alongside the master branch working copy
# directory:
rm -rf ../project-gh-pages
git -C .. clone [email protected]:Carrene/wolf.git -b gh-pages project-gh-pages
GIT="git -C ../project-gh-pages"
$GIT rm $VERSION/\*.md
mkdir -p $TARGET
$GIT rm $VERSION/\*.md
cp data/documentation/*.md $TARGET
$GIT add $VERSION/\*.md
$GIT config user.name "Travis CI"
Expand Down

0 comments on commit d2a5ba7

Please sign in to comment.