Skip to content

Commit

Permalink
Pushing doc to github.io
Browse files Browse the repository at this point in the history
  • Loading branch information
waterponey committed Oct 27, 2015
1 parent 0ba5c24 commit c365ab9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
6 changes: 6 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ machine:
dependencies:
cache_directories:
- "~/scikit_learn_data"
- "~/scikit-learn.github.io"
# Various dependencies
pre:
- sudo apt-get update
Expand All @@ -22,6 +23,11 @@ test:
# Grep error on the documentation
override:
- cat ~/log.txt && if grep -q "Traceback (most recent call last):" ~/log.txt; then false; else true; fi
deployment:
push:
branch: master
commands:
- bash continuous_integration/push_doc.sh
general:
# Open the doc to the API
artifacts:
Expand Down
33 changes: 33 additions & 0 deletions continuous_integration/push_doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# This script is meant to be called in the "deploy" step defined in
# circle.yml. See https://circleci.com/docs/ for more details.
# The behavior of the script is controlled by environment variable defined
# in the circle.yml in the top level folder of the project.


if [ -z $CIRCLE_PROJECT_USERNAME ];
then USERNAME="sklearn-ci";
else USERNAME=$CIRCLE_PROJECT_USERNAME;
fi

DOC_REPO="scikit-learn.github.io"

MSG="Pushing the docs for revision for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1"

cd $HOME
if [ ! -d $DOC_REPO ];
then git clone "[email protected]:scikit-learn/"$DOC_REPO".git";
fi
cd $DOC_REPO
git checkout master
git reset --hard origin/master
git rm -rf dev/ && rm -rf dev/
cp -R $HOME/scikit-learn/doc/_build/html/stable dev
git config --global user.email "[email protected]"
git config --global user.name $USERNAME
git config --global push.default matching
git add -f dev/
git commit -m "$MSG" dev
git push

echo $MSG

0 comments on commit c365ab9

Please sign in to comment.