File: publish-doc.sh

package info (click to toggle)
pgrouting 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,232 kB
  • ctags: 1,566
  • sloc: cpp: 74,626; ansic: 6,036; sql: 2,889; sh: 635; perl: 523; makefile: 67
file content (38 lines) | stat: -rwxr-xr-x 1,002 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# ------------------------------------------------------------------------------
# pgRouting Scripts
# Copyright(c) pgRouting Contributors
#
# Publish Documentation
# ------------------------------------------------------------------------------
if test a$1 = a ; then
    echo "Usage: publish-doc.sh dir"
    echo "       where dir might be dev or v2.0"
    exit 1
fi

VERSION=`git describe --tags --long`
BRANCH=`git branch | grep '*' | awk '{print $2}'`

if test ! -d build ; then
    echo "Error 'build' directory does not exist."
    exit 1
fi

# Switch branch
git checkout gh-pages && rm -Rf "$1" 

# Copy files and directories
mkdir "$1"
cp -R build/doc/html/en "$1"/en
cp build/doc/html/index.html .
cp build/doc/latex/en/pgRoutingDocumentation.pdf "$1"/en/
gzip -c build/doc/man/en/pgrouting.7 > "$1"/en/pgrouting.7.gz

# Commit changes
git add "$1" 
git add index.html
git commit -m "Updated to commit $VERSION" . && git push origin gh-pages

# Switch branch
git checkout $BRANCH