Skip to content

Commit affe5c5

Browse files
committed
Merge pull request #83 from Ayaro/development
Push documentation to different folders
2 parents d0a92af + e4213c3 commit affe5c5

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

ci_scripts/push_doc.sh

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,39 @@
44
# The behavior of the script is controlled by environment variable defined
55
# in the circle.yml in the top level folder of the project.
66

7-
MSG="Pushing the docs for revision for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1"
7+
if [ ! -z "$1" ]
8+
then DOC_FOLDER=$1
9+
fi
10+
11+
MSG="Pushing the docs for revision for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1, folder: $DOC_FOLDER"
812

913
cd $HOME
10-
# Copy the build docs to a temporary folder
11-
rm -rf tmp
12-
mkdir tmp
13-
cp -R $HOME/$DOC_REPO/doc/build/html/* ./tmp/
1414

1515
# Clone the docs repo if it isnt already there
1616
if [ ! -d $DOC_REPO ];
1717
then git clone "[email protected]:$USERNAME/"$DOC_REPO".git";
1818
fi
1919

20+
# Copy the build docs to a temporary folder
21+
rm -rf tmp
22+
mkdir tmp
23+
cp -R $HOME/$DOC_REPO/doc/build/html/* ./tmp/
24+
2025
cd $DOC_REPO
2126
git branch gh-pages
2227
git checkout -f gh-pages
2328
git reset --hard origin/gh-pages
2429
git clean -dfx
25-
26-
for name in $(ls -A $HOME/$DOC_REPO); do
27-
case $name in
28-
.nojekyll) # So that github does not build this as a Jekyll website.
29-
;;
30-
circle.yml) # Config so that build gh-pages branch.
31-
;;
32-
*)
33-
git rm -rf $name
34-
;;
35-
esac
36-
done
30+
git rm -rf $HOME/$DOC_REPO/$DOC_FOLDER && rm -rf $HOME/$DOC_REPO/$DOC_FOLDER
3731

3832
# Copy the new build docs
39-
mkdir $DOC_URL
40-
cp -R $HOME/tmp/* ./$DOC_URL/
33+
mkdir $DOC_FOLDER
34+
cp -R $HOME/tmp/* ./$DOC_FOLDER/
4135

4236
git config --global user.email $EMAIL
4337
git config --global user.name $USERNAME
44-
git add -f ./$DOC_URL/
38+
git add -f ./$DOC_FOLDER/
4539
git commit -m "$MSG"
4640
git push -f origin gh-pages
4741

48-
echo $MSG
42+
echo $MSG

circle.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ test:
4444
override:
4545
- cat ~/log.txt && if grep -q "Traceback (most recent call last):" ~/log.txt; then false; else true; fi
4646
deployment:
47-
push:
47+
master:
48+
branch: master
49+
commands:
50+
- bash ci_scripts/push_doc.sh 'stable'
51+
development:
4852
branch: development
4953
commands:
50-
- bash ci_scripts/push_doc.sh
54+
- bash ci_scripts/push_doc.sh 'dev'
5155
general:
5256
# Open the doc to the API
5357
artifacts:
@@ -57,3 +61,4 @@ general:
5761
branches:
5862
only:
5963
- development
64+
- master

0 commit comments

Comments
 (0)