forked from plumed/plumed2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pushdoc
executable file
·58 lines (49 loc) · 1.48 KB
/
pushdoc
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/bash
set -e
set -x
hash=$( git log -1 --format="%h")
root="$PWD"
mkdir -p tmp/$$
cd tmp/$$
# grab doc
mkdir user-doc
cp -R $root/user-doc/{html,manual.pdf} user-doc/
test -d $root/user-doc/regtests && cp -R $root/user-doc/regtests user-doc/ || true
mkdir developer-doc
cp -R $root/developer-doc/html developer-doc/
# This file should be here, it is needed otherwise
# files beginning with _ are skipped
touch .nojekyll
cat > index.html << EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Page Auto Redirect</title>
<meta http-equiv="refresh" content ="0; user-doc/html/index.html">
</head>
<body>
This is an auto redirect page.
</body>
</html>
EOF
git init
git config user.email "giovanni.bussi+plumedbot@gmail.com"
git config user.name "plumedbot"
git checkout -b gh-pages
# this is not to show the GIT_TOKEN on Travis log
set +x
git remote add doc https://plumedbot:$GIT_TOKEN@github.com/plumed/doc-${TRAVIS_BRANCH}.git
set -x
cat > README.md << EOF
Precompiled manual for PLUMED ${TRAVIS_BRANCH}
-----------------------------
This repository hosts a precompiled manual
for PLUMED ${TRAVIS_BRANCH}, git revision $hash, $(date).
This manual has been compiled on [travis](http://travis-ci.org/plumed/plumed2).
To browse the manual you should go
[here](http://plumed.github.io/doc-${TRAVIS_BRANCH}).
EOF
git add --all .
git commit -m "Update to plumed/plumed2@$hash"
# -q and 2> is not to show the GIT_TOKEN on Travis log
git push -q -f doc gh-pages 2> /dev/null