Skip to content

Commit a336eb0

Browse files
Add makefile (#22)
1 parent ea4d173 commit a336eb0

File tree

3 files changed

+59
-4
lines changed

3 files changed

+59
-4
lines changed

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
all: serve
2+
3+
build:
4+
mkdocs build
5+
6+
serve:
7+
mkdocs serve
8+
9+
release:
10+
./bin/release.sh
11+

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,35 @@ This hosts the documentation source and examples for [Bullet](https://github.com
44

55
The built documentation can be accessed [here](https://bullet-db.github.io).
66

7-
## Building the documentation
7+
## Installing mkdocs
88

99
You will need Python installed.
1010

11+
You can install the required tool "mkdocs" like this (a "mkdocs" directory will be created wherever you execute these commands):
12+
1113
```bash
1214
sudo pip install virtualenv
1315
virtualenv mkdocs
1416
source mkdocs/bin/activate
1517
pip install mkdocs==0.16.3
1618
pip install mkdocs-cinder
1719
pip install git+git://github.com/twardoch/clinker-mktheme.git@master --upgrade
18-
git clone git@github.com:bullet-db/bullet-db.github.io.git
19-
cd bullet-db.github.io
20-
mkdocs serve
2120
```
2221

2322
The above commands will install [mkdocs](http://www.mkdocs.org/#installation) along with the mkdocs theme : [Cinder](http://sourcefoundry.org/cinder/).
2423

2524
Since Cinder has not been upgraded in a while, it uses the changes in this [PR](https://github.com/chrissimpkins/cinder/pull/26) of Cinder found here: [twardoch/clinker-mktheme](https://github.com/twardoch/clinker-mktheme/tree/master).
2625

26+
## Building the Documentation
27+
28+
Once mkdocs is available:
29+
30+
`make build` will build the documentation.
31+
32+
`make serve` will serve the documentation so it can be viewed from a local browser.
33+
34+
`make release` will build a release and commit it to your local "master" branch. This command assumes you have a clean git environment ("git diff" prints nothing). It will build the documentation and commit it to your local master branch. **YOU must push the changes** in your master branch to the remote repo if you want to publish the changes after the command completes successfully.
35+
2736
## Building the examples
2837

2938
You will need [Maven 3](https://maven.apache.org/install.html) and [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed to build the examples.

bin/release.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
# This script will build the documentation from the current "src" branch and push it to the "master" branch.
4+
# "mkdocs" must be available, and you must be in a clean git environment ("git diff" should print nothing).
5+
6+
git checkout src
7+
git pull
8+
COMMIT=`git rev-parse HEAD | cut -c 1-7`
9+
echo Building docs...
10+
mkdocs build
11+
if [ $? -ne 0 ]; then
12+
echo ------------------ ERROR ------------------
13+
echo mkdocs must be installed
14+
echo see README.md for more info
15+
echo -------------------------------------------
16+
exit 1;
17+
fi
18+
set -e
19+
rm -rf /tmp/tmp-folder-for-bullet-docs/
20+
mkdir -p /tmp/tmp-folder-for-bullet-docs/
21+
mv site/ /tmp/tmp-folder-for-bullet-docs/
22+
echo Checking out master...
23+
git checkout master
24+
git pull
25+
# Carefully delete everything in this folder
26+
rm -rf ./*
27+
cp -r /tmp/tmp-folder-for-bullet-docs/site/ ./
28+
rm -rf /tmp/tmp-folder-for-bullet-docs/
29+
git add -A
30+
git commit -m "Build at ${COMMIT}"
31+
echo ---------------- SUCCESS --------------------
32+
echo The documentation has been built locally
33+
echo You are on the **master** branch
34+
echo DO "git push" TO PUSH CHANGES TO REMOTE REPO
35+
echo ---------------------------------------------

0 commit comments

Comments
 (0)