-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
update_gh-pages.sh
executable file
·35 lines (28 loc) · 1.56 KB
/
update_gh-pages.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 -e
GH_REF=github.com/killbill/killbill-docs.git
BUILD=`mktemp -d "${TMPDIR:-/tmp}"/foo.XXXX`
cp -r build $BUILD
pushd $BUILD
git clone --depth=5 --branch=gh-pages https://$GH_REF
popd
cp -f $BUILD/build/selfcontained/index.html $BUILD/killbill-docs/
# Copy assets (see make.sh)
cp -rf $BUILD/build/selfcontained/stylesheets/* $BUILD/killbill-docs/stylesheets/
cp -rf $BUILD/build/selfcontained/javascripts/* $BUILD/killbill-docs/javascripts/
VERSION=$(cat $BUILD/killbill-docs/latest.txt)
mkdir -p $BUILD/killbill-docs/$VERSION $BUILD/killbill-docs/$VERSION/stylesheets $BUILD/killbill-docs/$VERSION/javascripts
cp -f $BUILD/build/selfcontained/* $BUILD/killbill-docs/$VERSION/
cp -rf $BUILD/build/selfcontained/stylesheets/* $BUILD/killbill-docs/$VERSION/stylesheets/
cp -rf $BUILD/build/selfcontained/javascripts/* $BUILD/killbill-docs/$VERSION/javascripts/
mkdir -p $BUILD/killbill-docs/latest $BUILD/killbill-docs/latest/stylesheets $BUILD/killbill-docs/latest/javascripts
# This will also copy the manually generated files (*.xsd, ddl.sql)
cp -f $BUILD/killbill-docs/$VERSION/* $BUILD/killbill-docs/latest/
cp -rf $BUILD/killbill-docs/$VERSION/stylesheets/* $BUILD/killbill-docs/latest/stylesheets/
cp -rf $BUILD/killbill-docs/$VERSION/javascripts/* $BUILD/killbill-docs/latest/javascripts/
pushd $BUILD/killbill-docs
git config user.name "Kill Bill core team"
git config user.email "[email protected]"
git add $VERSION latest stylesheets javascripts index.html
git commit -m "Docs update"
git push -f "https://${GH_TOKEN}:x-oauth-basic@${GH_REF}" gh-pages:gh-pages
popd