Mercurial > dive4elements > river
comparison contrib/make_flys_release/make_release.sh @ 5379:61bf64b102bc mapgenfix
Merge with default branch
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 22 Mar 2013 11:25:54 +0100 |
parents | 53aee7e9ce53 |
children | c841eac48474 |
comparison
equal
deleted
inserted
replaced
5175:cfc5540a4eec | 5379:61bf64b102bc |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 # Release script for Flys |
3 echo "INFO: define required variables" | 3 # |
4 # Authors: | |
5 # Andre Heinecke <aheinecke@intevation.de> | |
6 # | |
7 # Copyright: | |
8 # Copyright (C) 2013 Intevation GmbH | |
9 # | |
10 # This program is free software; you can redistribute it and/or | |
11 # modify it under the terms of the GNU General Public License | |
12 # as published by the Free Software Foundation; either version 2 | |
13 # of the License, or (at your option) any later version. | |
14 # | |
15 # This program is distributed in the hope that it will be useful, | |
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 # GNU General Public License for more details. | |
19 # | |
20 # You should have received a copy of the GNU General Public License | |
21 # along with this program; if not, write to the Free Software | |
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
23 | |
24 set -e | |
25 DEFAULT_WD=/tmp/flys-release | |
26 DEVELOPER=aheinecke | |
27 | |
4 ARTIFACTS_HG_REPO="http://wald.intevation.org/hg/dive4elements/artifacts" | 28 ARTIFACTS_HG_REPO="http://wald.intevation.org/hg/dive4elements/artifacts" |
5 HTTPCLIIENT_HG_REPO="http://wald.intevation.org/hg/dive4elements/http-client" | 29 HTTPCLIIENT_HG_REPO="http://wald.intevation.org/hg/dive4elements/http-client" |
6 FLYS_HG_REPO="http://wald.intevation.org/hg/dive4elements/flys" | 30 FLYS_HG_REPO="http://wald.intevation.org/hg/dive4elements/flys" |
7 | 31 |
8 ARTIFACTS_HG="hg.artifacts" | 32 REPOS="artifacts http-client flys" |
9 HTTPCLIENT_HG="hg.http-client" | 33 # Do not use spaces in path |
10 FLYS_HG="hg.flys" | 34 FLYS_SOURCE_DIR=/local-vol1/aheinecke/flys-release |
11 | 35 |
12 PREFIX="flys-" | 36 ORACLE_HIBERNATE=$FLYS_SOURCE_DIR/hibernate-spatial-oracle-1.1.jar |
13 RELEASE=${RELEASE:-default} | 37 ORACLE_JDBC=$FLYS_SOURCE_DIR/ojdbc5.jar |
14 RELEASE_DATE=`date +'%Y-%m-%d'` | 38 |
15 DIRECTORY=$PREFIX$RELEASE-$RELEASE_DATE | 39 SCRIPT_DIR=$(readlink -f `dirname $0`) |
16 | 40 usage(){ |
17 ARTIFACT_PORT=${ARTIFACT_PORT:-9002} | 41 cat << EOF |
18 TOMCAT_PORT=${TOMCAT_PORT:-8005} | 42 |
19 | 43 usage: $0 [options] VERSION |
20 MAPSERVER_URL=${MAPSERVER_URL:-czech-republic.atlas.intevation.de} | 44 |
21 | 45 Create a flys package |
22 echo "INFO: create server directories" | 46 |
23 mkdir -p $DIRECTORY/server/bin/lib/own | 47 OPTIONS: |
24 mkdir $DIRECTORY/server/shapefiles | 48 -?, --help Show this message |
25 mkdir $DIRECTORY/client | 49 -w The working directory to use. (do not use spaces in path) |
26 | 50 Default: $DEFAULT_WD |
27 echo "INFO: checkout sources" | 51 -t Tag the current default branch as "VERSION" |
28 echo " ... checkout $ARTIFACTS_HG_REPO" | 52 -o, --oracle Release is for oracle. |
29 | 53 VERSION must be in the format MAYOR.MINOR.PATCH |
30 rm -rf $ARTIFACTS_HG | 54 EOF |
31 hg clone $ARTIFACTS_HG_REPO $ARTIFACTS_HG | 55 exit 0 |
32 (cd $ARTIFACTS_HG && hg co $RELEASE) | 56 } |
33 | 57 # --backend-db-url Url of database backend. Default: $BACKENDURL |
34 echo " ... checkout $HTTPCLIIENT_HG_REPO" | 58 # --backend-db-pass Backend db password. Default: $BACKENDPASS |
35 rm -rf $HTTPCLIENT_HG | 59 # --backend-db-port Backend db port. Default: $BACKENDPORT |
36 hg clone $HTTPCLIIENT_HG_REPO $HTTPCLIENT_HG | 60 # --backend-db-user Backend db user. Default: $BACKENDUSER |
37 (cd $HTTPCLIENT_HG && hg co $RELEASE) | 61 # --backend-db-backend Backend db backend name. Default: $BACKENDBACK |
38 | 62 # --seddb-url Sediment db url. Default: $SEDDBURL |
39 echo " ... checkout $FLYS_HG_REPO" | 63 # --seddb-port Sediment db port. Default: $SEDDBPORT |
40 rm -rf $FLYS_HG | 64 # --seddb-user Sediment db user. Default: $SEDDBUSER |
41 hg clone $FLYS_HG_REPO $FLYS_HG | 65 # --seddb-pass Sediment db password. Default: $SEDDBPASS |
42 (cd $FLYS_HG && hg co $RELEASE) | 66 # --seddb-back Sediment db backend. Default: $SEDDBBACK |
43 | 67 TOMCAT_PORT=${TOMCAT_PORT:-8282} |
44 # adapt client configuration | 68 MAPSERVER_URL=${MAPSERVER_URL:-flys-devel.intevation.de} |
45 echo "INFO: prepare configuration of web client" | 69 WIKI_URL=${WIKI_URL:-https://flys-intern.intevation.de/Flys-3.0} |
46 | 70 |
71 # Seddb Configuration | |
72 SEDDBURL=${SEDDBURL:-czech-republic.atlas.intevation.de} | |
73 SEDDBPORT=${SEDDBPORT:-1521} | |
74 SEDDBBACK=${SEDDBBACK:-XE} | |
75 SEDDBUSER=${SEDDBUSER:-seddb} | |
76 SEDDBPASS=${SEDDBPASS:-seddbpass} | |
77 | |
78 # Backend configuration | |
79 BACKENDURL=${BACKENDURL:-czech-republic.atlas.intevation.de} | |
80 BACKENDPORT=${BACKENDPORT:-5432} | |
81 BACKENDBACK=${BACKENDBACK:-flys_2913} | |
82 BACKENDUSER=${BACKENDUSER:-flys_dami} | |
83 BACKENDPASS=${BACKENDPASS:-flys_dami} | |
84 INITSQLS=${INITSQLS:-} | |
85 LOG_DIR=/var/log/flys | |
86 | |
87 OPTS=`getopt -o ?w:,t,o \ | |
88 -l help,oracle \ | |
89 -n $0 -- "$@"` | |
90 | |
91 if [ $? != 0 ] ; then usage; fi | |
92 eval set -- "$OPTS" | |
93 while true ; do | |
94 case "$1" in | |
95 "-?"|"--help") | |
96 usage;; | |
97 "--") | |
98 shift | |
99 break;; | |
100 "-w") | |
101 WORK_DIR=$2 | |
102 shift 2;; | |
103 "-o"|"--oracle") | |
104 BUILD_ORACLE="TRUE" | |
105 shift;; | |
106 "-t") | |
107 DO_TAG="TRUE" | |
108 shift;; | |
109 *) | |
110 echo "Unknown Option $1" | |
111 usage;; | |
112 esac | |
113 done | |
114 | |
115 if [ $# != 1 ]; then | |
116 usage | |
117 fi | |
118 | |
119 VERSION=$1 | |
120 ARTIFACT_PORT=${ARTIFACT_PORT:-`echo 1$VERSION | sed 's/\.//g'`} | |
121 | |
122 if [ -z $WORK_DIR ]; then | |
123 WORK_DIR=$DEFAULT_WD | |
124 fi | |
125 | |
126 mkdir -p $WORK_DIR | |
127 | |
128 if [ ! -d $FLYS_SOURCE_DIR ]; then | |
129 mkdir -p $FLYS_SOURCE_DIR | |
130 echo "Cloning sources" | |
131 cd $FLYS_SOURCE_DIR | |
132 hg clone $ARTIFACTS_HG_REPO artifacts | |
133 hg clone $HTTPCLIIENT_HG_REPO http-client | |
134 hg clone $FLYS_HG_REPO flys | |
135 else | |
136 echo "Updating sources / Reverting changes" | |
137 cd $FLYS_SOURCE_DIR | |
138 for repo in $REPOS; do | |
139 cd $repo && hg pull && hg up && hg revert -a && cd $FLYS_SOURCE_DIR | |
140 done; | |
141 fi | |
142 | |
143 if [ "$DO_TAG" = "TRUE" ]; then | |
144 echo "Tagging version $VERSION" | |
145 for repo in $REPOS; do | |
146 cd $repo | |
147 CHANGESET=$(hg log -l1 |head -1 | awk -F: '{print $3}') | |
148 echo "" | |
149 echo "Do you really want to tag $repo rev: $CHANGESET as Version $VERSION?" | |
150 echo "press enter to continue or CTRL+C to abort." | |
151 echo "" | |
152 hg log -l1 | |
153 read | |
154 OLD_REV=$(cat .hgtags | tail -1 | awk '{print $2}') | |
155 hg tag $VERSION -m "Added tag $VERSION for changeset $CHANGESET" | |
156 hg push ssh://$DEVELOPER@scm.wald.intevation.org/hg/dive4elements/$repo | |
157 echo "Changelog for $repo" >> $WORK_DIR/changes_$OLD_REV-$VERSION.txt | |
158 echo "#############################################################################" \ | |
159 >> $WORK_DIR/changes_$OLD_REV-$VERSION.txt | |
160 hg log -r $VERSION:$OLD_REV --style changelog >> $WORK_DIR/changes_$OLD_REV-$VERSION.txt | |
161 cd $FLYS_SOURCE_DIR | |
162 done; | |
163 fi | |
164 | |
165 # Update to current version | |
166 for repo in $REPOS; do | |
167 cd $repo | |
168 hg up $VERSION | |
169 cd $FLYS_SOURCE_DIR | |
170 done | |
171 | |
172 rm -rf "$WORK_DIR/server" "$WORK_DIR/client" | |
173 cd $WORK_DIR | |
174 mkdir -p "$WORK_DIR/server/bin/lib/own" | |
175 mkdir "$WORK_DIR/server/shapefiles" | |
176 mkdir "$WORK_DIR/client" | |
177 | |
178 echo "[INFO]: Preparing configuration of web client" | |
179 echo "[INFO]: Tomcat Port: $TOMCAT_PORT" | |
180 echo "[INFO]: Artifact Port: $ARTIFACT_PORT" | |
47 sed -i -e "s@http://localhost:8181@http://localhost:$ARTIFACT_PORT@g" \ | 181 sed -i -e "s@http://localhost:8181@http://localhost:$ARTIFACT_PORT@g" \ |
48 -e "s@http://localhost:8888@http://localhost:$TOMCAT_PORT@g" \ | 182 -e "s@http://localhost:8888@http://localhost:$TOMCAT_PORT@g" \ |
49 $FLYS_HG/flys-client/src/main/webapp/WEB-INF/web.xml | 183 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/web.xml |
50 | 184 |
51 sed -i -e "s@/tmp/flys-client.log@/tmp/flys-client-${RELEASE}.log@g" \ | 185 sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log@g" \ |
52 $FLYS_HG/flys-client/src/main/webapp/WEB-INF/log4j.properties | 186 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/log4j.properties |
53 | 187 |
54 echo "INFO: download OpenLayers-2.11 for client" | 188 find $FLYS_SOURCE_DIR/flys/flys-artifacts/src/main/resources/ -name messages\*.properties | \ |
55 curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz | 189 xargs sed -i "s@https://flys-intern.intevation.de/Flys-3.0@${WIKI_URL}@g"; |
56 tar xvfz OpenLayers-2.11.tar.gz | 190 |
57 # TODO: Remove more superfluous OpenLayers stuff. | 191 find $FLYS_SOURCE_DIR/flys/ -name \*.properties -o -name \*.xsl | \ |
58 rm -rf OpenLayers-2.11/doc | 192 xargs sed -i "s@https://flys-intern.intevation.de@${WIKI_URL}@g"; |
59 rm -rf OpenLayers-2.11/tests | 193 |
60 rm -rf OpenLayers-2.11/examples | 194 if [ ! -f $FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz ]; then |
61 mv OpenLayers-2.11 $FLYS_HG/flys-client/src/main/webapp/ | 195 echo "INFO: download OpenLayers-2.11 for client" |
62 | 196 cd $FLYS_SOURCE_DIR |
63 # compile and build our code stuff | 197 curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz |
198 tar xvfz OpenLayers-2.11.tar.gz | |
199 # TODO: Remove more superfluous OpenLayers stuff. | |
200 rm -rf OpenLayers-2.11/doc | |
201 rm -rf OpenLayers-2.11/tests | |
202 rm -rf OpenLayers-2.11/examples | |
203 cd $WORK_DIR | |
204 fi | |
205 cp -r $FLYS_SOURCE_DIR/OpenLayers-2.11 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/ | |
206 | |
64 echo "INFO: compile and build sources" | 207 echo "INFO: compile and build sources" |
65 mvn -f $ARTIFACTS_HG/pom.xml clean compile package install | 208 mvn -f $FLYS_SOURCE_DIR/artifacts/pom.xml clean compile package install |
66 mvn -f $FLYS_HG/flys-backend/pom.xml clean compile package install | 209 mvn -f $FLYS_SOURCE_DIR/flys/flys-backend/pom.xml clean compile package install |
67 mvn -f $FLYS_HG/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies install | 210 mvn -f $FLYS_SOURCE_DIR/flys/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies install |
68 mvn -f $HTTPCLIENT_HG/pom.xml clean compile package install | 211 mvn -f $FLYS_SOURCE_DIR/http-client/pom.xml clean compile package install |
69 mvn -f $FLYS_HG/flys-client/pom.xml clean compile package | 212 mvn -f $FLYS_SOURCE_DIR/flys/flys-client/pom.xml clean compile package |
70 | 213 |
71 ## fetch the java stuff | 214 |
72 echo "INFO: copy dependencies and libs" | 215 echo "INFO: copy dependencies and libs" |
73 cp $ARTIFACTS_HG/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ | 216 cp $FLYS_SOURCE_DIR/artifacts/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ |
74 cp $ARTIFACTS_HG/artifacts/target/artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ | 217 cp $FLYS_SOURCE_DIR/artifacts/artifacts/target/artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ |
75 cp $ARTIFACTS_HG/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ | 218 cp $FLYS_SOURCE_DIR/artifacts/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ |
76 cp $FLYS_HG/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ | 219 cp $FLYS_SOURCE_DIR/flys/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ |
77 cp $FLYS_HG/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ | 220 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ |
78 cp $FLYS_HG/flys-client/target/FLYS-1.0-SNAPSHOT.war $DIRECTORY/client/flys-${RELEASE}.war | 221 cp $FLYS_SOURCE_DIR/flys/flys-client/target/FLYS-1.0-SNAPSHOT.war $WORK_DIR/client/flys-${VERSION}.war |
79 cp $FLYS_HG/flys-artifacts/target/dependency/* $DIRECTORY/server/bin/lib/ | 222 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/target/dependency/* $WORK_DIR/server/bin/lib/ |
80 | 223 |
81 echo "INFO: copy scripts and libraries to target destination" | 224 echo "INFO: copy scripts and libraries to target destination" |
82 cp bin/run.sh $DIRECTORY/server/bin/ | 225 cp ${SCRIPT_DIR}/bin/run.sh $WORK_DIR/server/bin/ |
83 cp bin/wsplgen.exe $DIRECTORY/server/bin/ | 226 cp ${SCRIPT_DIR}/bin/wsplgen.exe $WORK_DIR/server/bin/ |
84 cp libs/* $DIRECTORY/server/bin/lib/ | 227 cp ${SCRIPT_DIR}/libs/* $WORK_DIR/server/bin/lib/ |
85 | 228 |
86 #echo "INFO: remove PostgreSQL and PostGIS libraries" | 229 |
87 #rm $DIRECTORY/server/bin/lib/postg* | 230 if [ "$BUILD_ORACLE" = "TRUE" ]; then |
88 #rm $DIRECTORY/server/bin/lib/hibernate-spatial-postgis* | 231 echo "INFO: remove PostgreSQL and PostGIS libraries" |
89 | 232 rm $WORK_DIR/server/bin/lib/postg* |
90 echo "INFO: remove Oralce libraries" | 233 rm $WORK_DIR/server/bin/lib/hibernate-spatial-postgis* |
91 rm -f $DIRECTORY/server/bin/lib/hibernate-spatial-oracle-1.1.jar | 234 if [ ! -f $ORACLE_JDBC ]; then |
92 rm -f $DIRECTORY/server/bin/lib/ojdbc* | 235 echo "Could not find oracle jdbc in $ORACLE_JDBC" |
236 echo "Please make sure that the ORACLE_JDBC variable is set correctly" | |
237 exit 1 | |
238 fi | |
239 if [ ! -f $ORACLE_HIBERNATE ]; then | |
240 echo "Could not find hibernate-spatial-oracle in $ORACLE_HIBERNATE" | |
241 echo "Please make sure that the ORACLE_HIBERNATE variable is set correctly" | |
242 exit 1 | |
243 fi | |
244 cp $ORACLE_HIBERNATE $ORACLE_JDBC $WORK_DIR/server/bin/lib/ | |
245 else | |
246 echo "INFO: remove Oralce libraries" | |
247 rm -f $WORK_DIR/server/bin/lib/hibernate-spatial-oracle-1.1.jar | |
248 rm -f $WORK_DIR/server/bin/lib/ojdbc* | |
249 fi | |
93 | 250 |
94 # fetch the configuration stuff | 251 # fetch the configuration stuff |
95 echo "INFO: copy default configuration to target destination" | 252 echo "INFO: copy default configuration to target destination" |
96 cp -R $FLYS_HG/flys-artifacts/doc/conf $DIRECTORY/server/ | 253 cp -R $FLYS_SOURCE_DIR/flys/flys-artifacts/doc/conf $WORK_DIR/server/ |
97 | 254 |
98 #cp confs/* $DIRECTORY/server/conf/ | 255 sed -i "s/8181/$ARTIFACT_PORT/g" \ |
99 mkdir -p $DIRECTORY/server/conf | 256 $WORK_DIR/server/conf/rest-server.xml |
100 | 257 |
101 sed "s/8999/$ARTIFACT_PORT/g" \ | 258 sed -i -e "s@http://example.com/@http://${MAPSERVER_URL}/@g" \ |
102 confs/rest-server.xml \ | 259 $WORK_DIR/server/conf/floodmap.xml |
103 > $DIRECTORY/server/conf/rest-server.xml | 260 |
104 | 261 sed -i -e "s@http://example.com/@http://${MAPSERVER_URL}/@g" \ |
105 sed -e "s@http://example.com/@http://${MAPSERVER_URL}/@g" \ | 262 $WORK_DIR/server/conf/rivermap.xml |
106 confs/floodmap.xml \ | 263 |
107 > $DIRECTORY/server/conf/floodmap.xml | 264 sed -i -e "s@/tmp/flys-rivers-wms.log@${LOG_DIR}/rivers-wms-${VERSION}.log@g" \ |
108 | 265 $WORK_DIR/server/conf/mapserver/river-mapfile.vm |
109 sed -e "s@http://example.com/@http://${MAPSERVER_URL}/@g" \ | 266 |
110 confs/rivermap.xml \ | 267 sed -i -e "s@/tmp/flys-user-wms.log@${LOG_DIR}/user-wms-${VERSION}.log@g" \ |
111 > $DIRECTORY/server/conf/rivermap.xml | 268 $WORK_DIR/server/conf/mapserver/mapfile.vm |
112 | 269 |
113 | 270 sed "s@/tmp/flys-server-default.log@${LOG_DIR}/server-${VERSION}.log@" \ |
114 sed "s@/tmp/flys-server-default.log@/tmp/flys-server-${RELEASE}.log" \ | 271 $SCRIPT_DIR/confs/log4j.properties \ |
115 confs/log4j.properties \ | 272 > $WORK_DIR/server/conf/log4j.properties |
116 > $DIRECTORY/server/conf/log4j.properties | 273 |
117 | 274 cat > $WORK_DIR/server/conf/seddb-db.xml << EOF |
118 # TODO: Use templating here | 275 <?xml version="1.0" encoding="UTF-8" ?> |
119 cp confs/seddb-db.xml $DIRECTORY/server/conf/seddb-db.xml | 276 <seddb-database> |
120 cp confs/backend-db.xml $DIRECTORY/server/conf/backend-db.xml | 277 <!-- This is the default SedDB db configuration. --> |
121 cp confs/artifact-db.xml $DIRECTORY/server/conf/artifact-db.xml | 278 <user>$SEDDBUSER</user> |
122 cp confs/datacage-db.xml $DIRECTORY/server/conf/datacage-db.xml | 279 <password>$SEDDBPASS</password> |
123 cp confs/mapserver/fontset.txt $DIRECTORY/server/conf/mapserver/fontset.txt | 280 <dialect>org.hibernate.dialect.Oracle9iDialect</dialect> |
124 | 281 <driver>oracle.jdbc.driver.OracleDriver</driver> |
125 cp $ARTIFACTS_HG/artifact-database/doc/schema-h2.sql h2/artifacts-h2.sql | 282 <url>jdbc:oracle:thin:@//$SEDDBURL:$SEDDBPORT/$SEDDBBACK </url> |
126 cp $FLYS_HG/flys-artifacts/doc/conf/datacage.sql h2/datacage.sql | 283 </seddb-database> |
284 EOF | |
285 | |
286 if [ "$BUILD_ORACLE" = "TRUE" ]; then | |
287 # Oracle backend configuration | |
288 cat > $WORK_DIR/server/conf/backend-db.xml << EOF | |
289 <?xml version="1.0" encoding="UTF-8" ?> | |
290 <backend-database> | |
291 <user>$BACKENDUSER</user> | |
292 <password>$BACKENDPASS</password> | |
293 <dialect>org.hibernatespatial.oracle.OracleSpatial10gDialect</dialect> | |
294 <driver>oracle.jdbc.driver.OracleDriver</driver> | |
295 <url>jdbc:oracle:thin:@//$BACKENDURL:$BACKENDPORT/$BACKENDBACK</url> | |
296 <connection-init-sqls>$INITSQLS</connection-init-sqls> | |
297 </backend-database> | |
298 EOF | |
299 else | |
300 #Postgresql backend configuration | |
301 cat > $WORK_DIR/server/conf/backend-db.xml << EOF | |
302 <?xml version="1.0" encoding="UTF-8" ?> | |
303 <backend-database> | |
304 <user>$BACKENDUSER</user> | |
305 <password>$BACKENDPASS</password> | |
306 <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect> | |
307 <driver>org.postgresql.Driver</driver> | |
308 <url>jdbc:postgresql://$BACKENDURL:$BACKENDPORT/$BACKENDBACK</url> | |
309 <connection-init-sqls>$INITSQLS</connection-init-sqls> | |
310 </backend-database> | |
311 EOF | |
312 fi | |
313 | |
314 mkdir $WORK_DIR/artifactsdb | |
315 mkdir $WORK_DIR/datacagedb | |
316 | |
317 cp $FLYS_SOURCE_DIR/artifacts/artifact-database/doc/schema-h2.sql $WORK_DIR/artifactsdb/artifacts-h2.sql | |
318 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/doc/conf/datacage.sql $WORK_DIR/datacagedb/datacage.sql | |
127 | 319 |
128 echo "INFO: create h2 database for artifacts and datacage" | 320 echo "INFO: create h2 database for artifacts and datacage" |
129 h2/createArtifacts.sh | 321 $SCRIPT_DIR/h2/createArtifacts.sh $WORK_DIR/artifactsdb/artifacts-h2.sql |
130 h2/createDatacage.sh | 322 $SCRIPT_DIR/h2/createDatacage.sh $WORK_DIR/datacagedb/datacage.sql |
131 | 323 |
132 mv artifactsdb $DIRECTORY/server/ | 324 mv $WORK_DIR/artifactsdb $WORK_DIR/server/ |
133 mv datacagedb $DIRECTORY/server/ | 325 mv $WORK_DIR/datacagedb $WORK_DIR/server/ |
134 | 326 |
135 echo "INFO: create tarball" | 327 echo "INFO: create tarball" |
136 tar cvfz $DIRECTORY.tar.gz $DIRECTORY | 328 mkdir $WORK_DIR/flys-$VERSION |
137 | 329 mv $WORK_DIR/server $WORK_DIR/client $WORK_DIR/flys-$VERSION |
138 echo "INFO: remove temporary files and directories" | 330 cd $WORK_DIR |
139 rm -rf $ARTIFACTS_HG | 331 tar cfz flys-$VERSION.tar.gz flys-$VERSION |
140 rm -rf $HTTPCLIENT_HG | 332 echo "INFO: cleanup" |
141 rm -rf $FLYS_HG | 333 #rm -r $WORK_DIR/flys-$VERSION |
142 rm -rf $DIRECTORY | 334 |
143 rm -rf OpenLayers.2.11.tar.gz | 335 echo "DONE: $WORK_DIR/flys-$VERSION.tar.gz" |
336 echo "Changelog: $WORK_DIR/changes_$OLD_REV-$VERSION.txt" |