forked from vkbo/SixTrackScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoBuildManual.sh
More file actions
executable file
·41 lines (35 loc) · 958 Bytes
/
autoBuildManual.sh
File metadata and controls
executable file
·41 lines (35 loc) · 958 Bytes
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
#!/bin/bash
mkdir -pv build
cd build
if [ -f "../cmake_six" ]; then
echo "Attemting to run the script from within the repository."
echo "This should no be done. Please copy this script to a separate folder and run it there."
exit 1
fi
if [ ! -d "SixTrack/.git" ]; then
echo "SixTrack source missing, pulling ..."
git clone https://github.com/SixTrack/SixTrack.git SixTrack
fi
cd SixTrack
git fetch origin master
git pull
if [ -f "../lastCommit.txt" ]; then
echo "Found last commit file"
LAST=$(cat ../lastCommit.txt)
echo "Last hash: $LAST"
else
LAST="None"
echo "Last hash: $LAST"
fi
CURR=$(git rev-parse HEAD)
echo "Current hash: $CURR"
if [ "$LAST" != "$CURR" ]; then
cd doc
echo "Hashes differ. Building manual."
./generateForWeb.sh &> ../../htmlBuild.log
echo "Uploading to website."
rsync -avPh html/ /afs/cern.ch/project/sixtrack/docs/
echo $CURR > ../../lastCommit.txt
else
echo "No change. Exiting."
fi