forked from couchbaselabs/docs-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pull_publish.sh
executable file
·35 lines (26 loc) · 945 Bytes
/
pull_publish.sh
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
#!/bin/bash
# check whether file ~/cronenv exists and if it does, read the file and execute the commands in it
if [ -e ~/cronenv ]
then
source ~/cronenv
fi
echo "Building docs at $(date)"
# extract directory name from the filename of the current script and cd to it
cd `dirname $0`
# retrieve names of git branches and pick out the one that is starred (current branch)
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
echo "On branch ${branch}, doing git pull"
# retrieve the latest files from the current git branch
git pull
# build the docs website
echo "Building site..."
bundle exec nanoc
#BIG UGLY HACK courtesy AMY 20140722
cp -r output/prebuilt/couchbase-manual-3.0/assets-dita output/assets-dita
# if on master branch, publish output files to S3
if [ "${branch}" == "master" ]
then
echo "On master branch, deploying to docs.couchbase.com"
s3cmd sync -P output/ s3://docs.couchbase.com/
fi
echo "Done at $(date)"