Skip to content

Commit 25ce228

Browse files
committed
Publishing docs to gh-pages instead of locally.
Added a script to generate doxygen docs from within $NUPIC, switch to the gh-pages branch, and publish the docs within that branch. Added start, stop, restart, status scripts that wrap 'forever'.
1 parent 5c32c9d commit 25ce228

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed

bin/generate_nupic_docs.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
## Assumptions
4+
# - NuPIC is checked out somewhere within reach cloned from
5+
# [email protected]:numenta/nupic.git as `origin`.
6+
# - $NUPIC points to the location of this checkout.
7+
# - A local `gh-pages` branch exists, tracking the remote 'gh-pages' branch.
8+
9+
echo
10+
echo "Building NuPIC API docs from $NUPIC"
11+
echo
12+
13+
if [ -z "$NUPIC" ]; then
14+
echo "In order for this script to run properly, you must have the "
15+
echo "\$NUPIC environment variable set to the NuPIC checkout."
16+
exit 1
17+
fi
18+
19+
cwd=`pwd`
20+
cd $NUPIC
21+
22+
echo "Checking out NuPIC master branch for doxygen build..."
23+
git checkout master
24+
git pull origin master
25+
26+
echo "Running Doxygen..."
27+
doxygen
28+
29+
echo "Checking out NuPIC gh-pages branch for documentation push..."
30+
git checkout gh-pages
31+
# pull latest changes
32+
git fetch origin
33+
git merge origin/gh-pages --no-edit
34+
# move html directory into right place
35+
rm -rf docs
36+
mv html docs
37+
# add new docs
38+
git add docs
39+
# commit new docs
40+
git commit -m "NuPIC Doxygen automated doc build."
41+
# push new docs
42+
git push origin gh-pages
43+
44+
echo "Switching back to NuPIC master branch..."
45+
git checkout master
46+
47+
echo
48+
echo Done.
49+
50+
cd $cwd

bin/restart.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
$script_dir/stop.sh
6+
$script_dir/start.sh

bin/start.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
cwd=`pwd`
5+
tools_server="${script_dir}/../program.js"
6+
7+
# Forever is a node.js tool used to keep programs running.
8+
9+
echo
10+
echo "Starting: ${tools_server}"
11+
forever start $tools_server
12+
13+
echo
14+
forever list

bin/status.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Forever is a node.js tool used to keep programs running.
4+
forever list

bin/stop.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Forever is a node.js tool used to keep programs running.
4+
forever stopall

0 commit comments

Comments
 (0)