-
Notifications
You must be signed in to change notification settings - Fork 12
/
gdalnightlysvn.sh
87 lines (73 loc) · 1.72 KB
/
gdalnightlysvn.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
#
# $Id$
#
# Script generates GDAL nightly snapshot packages.
#
###### CONFIGURATION BEGIN ######
VERBOSE=1
VERSION_STABLE="1.8"
# Make sure we get the right swig.
PATH=/usr/local/swig-1.3.39/bin:$PATH
###### CONFIGURATION END ######
if [ $# != 1 ] ; then
echo "Missing SVN branch!"
echo "Available branches: trunk, stable"
exit 1
fi
if [ $# -eq 1 ] ; then
BRANCH=$1
if test ! "${BRANCH}" = "trunk" -a ! "${BRANCH}" = "stable"; then
echo "Unknown branch passed!"
echo "Available branches: trunk, stable"
exit 1
fi
fi
if test ${VERBOSE} = 1; then
echo "Selecting GDAL branch: ${BRANCH}"
fi
GDAL="gdal"
SVNBRANCH="trunk"
if test "${BRANCH}" = "stable"; then
GDAL="gdal-${VERSION_STABLE}"
SVNBRANCH="branches/${VERSION_STABLE}"
fi
CWD=/var/www/gdal
DATE=`date +%Y%m%d`
DATEVER=`date +%Y.%m.%d`
NIGHTLYVER="svn-${BRANCH}-${DATEVER}"
BUILDER="/var/www/gdal/mkgdaldist.sh"
GDALDIR="${CWD}/${GDAL}"
DAILYDIR="/var/www/gdal/gdal-web/daily"
LOG="/dev/null"
if test ${VERBOSE} = 1; then
LOG=/var/www/gdal/nightly.log
echo -n "Building GDAL Nightly: ${NIGHTLYVER}..."
fi
if test ! -d ${GDALDIR}; then
mkdir ${GDALDIR}
fi
cd ${GDALDIR}
${BUILDER} ${NIGHTLYVER} -date ${DATE} -branch ${SVNBRANCH} >& ${LOG}
if test $? -gt 0; then
echo
echo "Command ${BUILDER} failed. Check ${LOG} file for details."
cd ${CWD}
exit 1
fi
cd ${CWD}
if test ${VERBOSE} = 1; then
echo "Done"
fi
if test ${VERBOSE} = 1; then
echo -n "Uploading ${NIGHTLYVER} to daily download..."
fi
find ${DAILYDIR} -name '*'${BRANCH}'*'
if test $? -eq 0 ; then
find ${DAILYDIR} -name '*'${BRANCH}'*' | xargs rm -f
fi
mv ${GDALDIR}/*${NIGHTLYVER}* ${DAILYDIR}
mv ${GDALDIR}/gdalsvn*.zip ${DAILYDIR}
if test ${VERBOSE} = 1; then
echo "Done"
fi