forked from automl/auto-sklearn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push documentation to different folders
- Loading branch information
1 parent
d0a92af
commit e4213c3
Showing
2 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,45 +4,39 @@ | |
# The behavior of the script is controlled by environment variable defined | ||
# in the circle.yml in the top level folder of the project. | ||
|
||
MSG="Pushing the docs for revision for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1" | ||
if [ ! -z "$1" ] | ||
then DOC_FOLDER=$1 | ||
fi | ||
|
||
MSG="Pushing the docs for revision for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1, folder: $DOC_FOLDER" | ||
|
||
cd $HOME | ||
# Copy the build docs to a temporary folder | ||
rm -rf tmp | ||
mkdir tmp | ||
cp -R $HOME/$DOC_REPO/doc/build/html/* ./tmp/ | ||
|
||
# Clone the docs repo if it isnt already there | ||
if [ ! -d $DOC_REPO ]; | ||
then git clone "[email protected]:$USERNAME/"$DOC_REPO".git"; | ||
fi | ||
|
||
# Copy the build docs to a temporary folder | ||
rm -rf tmp | ||
mkdir tmp | ||
cp -R $HOME/$DOC_REPO/doc/build/html/* ./tmp/ | ||
|
||
cd $DOC_REPO | ||
git branch gh-pages | ||
git checkout -f gh-pages | ||
git reset --hard origin/gh-pages | ||
git clean -dfx | ||
|
||
for name in $(ls -A $HOME/$DOC_REPO); do | ||
case $name in | ||
.nojekyll) # So that github does not build this as a Jekyll website. | ||
;; | ||
circle.yml) # Config so that build gh-pages branch. | ||
;; | ||
*) | ||
git rm -rf $name | ||
;; | ||
esac | ||
done | ||
git rm -rf $HOME/$DOC_REPO/$DOC_FOLDER && rm -rf $HOME/$DOC_REPO/$DOC_FOLDER | ||
|
||
# Copy the new build docs | ||
mkdir $DOC_URL | ||
cp -R $HOME/tmp/* ./$DOC_URL/ | ||
mkdir $DOC_FOLDER | ||
cp -R $HOME/tmp/* ./$DOC_FOLDER/ | ||
|
||
git config --global user.email $EMAIL | ||
git config --global user.name $USERNAME | ||
git add -f ./$DOC_URL/ | ||
git add -f ./$DOC_FOLDER/ | ||
git commit -m "$MSG" | ||
git push -f origin gh-pages | ||
|
||
echo $MSG | ||
echo $MSG |
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