-
-
Notifications
You must be signed in to change notification settings - Fork 703
/
cronjob.sh
executable file
·39 lines (30 loc) · 1.09 KB
/
cronjob.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
36
37
38
39
#!/bin/bash
# cd to script dir
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
now=`date`
echo "Starting: $now"
if [ -f running ]; then
echo "$0 still running"
exit 1
fi
touch running
trap "rm $PWD/running" EXIT
# throw away building artefacts or edits(!)
git stash
git stash drop
# get latest version from github
git pull
# Return release number from branch name e.g. master, 3.34
TARGETBRANCH=`git branch --show-current | sed 's,release_,,g'`
TARGETREPO="QGIS-Documentation"
if [[ "$TARGETBRANCH" != "master" ]]; then \
TARGETREPO=$TARGETREPO-$TARGETBRANCH
fi;
# NOTE: docker builds and rsync's the build/zip/pdf to the local mounted /site dir
# AFTER the build, we are going to rsync everything to www2.qgis.org
docker run -v $PWD:/build -v /var/www/qgisdata/$TARGETREPO/live/html:/site -w="/build" --rm=true --name="qgis_docs_"$TARGETBRANCH"_build" qgis/sphinx_pdf_3 make all
# in one go: ALL languages, the zip's AND the pdf's:
rsync -hrzc --delete --progress /var/www/qgisdata/$TARGETREPO/live/html www2.qgis.org:/var/www/qgisdata/$TARGETREPO/live/;
now=`date`
echo "Finished: $now"