comparison contrib/make_flys_release/make_release.sh @ 5900:8698e3284b7a

Update after renaming and remove the binary artifact-database and common
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 03 May 2013 18:03:41 +0200
parents 369e3201470d
children 75803c9eb63b
comparison
equal deleted inserted replaced
5899:45dd4331cb6d 5900:8698e3284b7a
23 23
24 set -e 24 set -e
25 DEFAULT_WD=/tmp/flys-release 25 DEFAULT_WD=/tmp/flys-release
26 DEVELOPER=aheinecke 26 DEVELOPER=aheinecke
27 27
28 ARTIFACTS_HG_REPO="http://wald.intevation.org/hg/dive4elements/artifacts" 28 ARTIFACTS_HG_REPO="http://wald.intevation.org/hg/dive4elements/framework"
29 HTTPCLIIENT_HG_REPO="http://wald.intevation.org/hg/dive4elements/http-client" 29 HTTPCLIIENT_HG_REPO="http://wald.intevation.org/hg/dive4elements/http-client"
30 FLYS_HG_REPO="http://wald.intevation.org/hg/dive4elements/flys" 30 FLYS_HG_REPO="http://wald.intevation.org/hg/dive4elements/river"
31 31
32 REPOS="artifacts http-client flys" 32 REPOS="river http-client framework"
33 # Do not use spaces in path 33 # Do not use spaces in path
34 FLYS_SOURCE_DIR=/local-vol1/aheinecke/flys-release 34 FLYS_SOURCE_DIR=/local-vol1/aheinecke/flys-release
35 35
36 ORACLE_HIBERNATE=$FLYS_SOURCE_DIR/hibernate-spatial-oracle-1.1.jar 36 ORACLE_HIBERNATE=$FLYS_SOURCE_DIR/hibernate-spatial-oracle-1.1.jar
37 ORACLE_JDBC=$FLYS_SOURCE_DIR/ojdbc5.jar 37 ORACLE_JDBC=$FLYS_SOURCE_DIR/ojdbc5.jar
84 BACKENDPORT=${BACKENDPORT:-5432} 84 BACKENDPORT=${BACKENDPORT:-5432}
85 BACKENDBACK=${BACKENDBACK:-flys_devel} 85 BACKENDBACK=${BACKENDBACK:-flys_devel}
86 BACKENDUSER=${BACKENDUSER:-flys_dami} 86 BACKENDUSER=${BACKENDUSER:-flys_dami}
87 BACKENDPASS=${BACKENDPASS:-flys_dami} 87 BACKENDPASS=${BACKENDPASS:-flys_dami}
88 INITSQLS=${INITSQLS:-} 88 INITSQLS=${INITSQLS:-}
89 DGM_PATH=${DGM_PATH:-/opt/flys/gewaesser} 89 DGM_PATH=${DGM_PATH:-/opt/river/gewaesser}
90 LOG_DIR=/var/log/flys 90 LOG_DIR=/var/log/flys
91 91
92 OPTS=`getopt -o ?w:,t,o \ 92 OPTS=`getopt -o ?w:,t,o \
93 -l help,oracle \ 93 -l help,oracle \
94 -n $0 -- "$@"` 94 -n $0 -- "$@"`
136 136
137 if [ ! -d $FLYS_SOURCE_DIR ]; then 137 if [ ! -d $FLYS_SOURCE_DIR ]; then
138 mkdir -p $FLYS_SOURCE_DIR 138 mkdir -p $FLYS_SOURCE_DIR
139 echo "Cloning sources" 139 echo "Cloning sources"
140 cd $FLYS_SOURCE_DIR 140 cd $FLYS_SOURCE_DIR
141 hg clone $ARTIFACTS_HG_REPO artifacts 141 hg clone $ARTIFACTS_HG_REPO framework
142 hg clone $HTTPCLIIENT_HG_REPO http-client 142 hg clone $HTTPCLIIENT_HG_REPO http-client
143 hg clone $FLYS_HG_REPO flys 143 hg clone $FLYS_HG_REPO river
144 else 144 else
145 echo "Updating sources / Reverting changes" 145 echo "Updating sources / Reverting changes"
146 cd $FLYS_SOURCE_DIR 146 cd $FLYS_SOURCE_DIR
147 for repo in $REPOS; do 147 for repo in $REPOS; do
148 cd $repo && hg pull && hg revert -a && hg up && cd $FLYS_SOURCE_DIR 148 cd $repo && hg pull && hg revert -a && hg up && cd $FLYS_SOURCE_DIR
187 echo "[INFO]: Preparing configuration of web client" 187 echo "[INFO]: Preparing configuration of web client"
188 echo "[INFO]: Tomcat Port: $TOMCAT_PORT" 188 echo "[INFO]: Tomcat Port: $TOMCAT_PORT"
189 echo "[INFO]: Artifact Port: $ARTIFACT_PORT" 189 echo "[INFO]: Artifact Port: $ARTIFACT_PORT"
190 190
191 #Needs to be done before the tomcat replacement below 191 #Needs to be done before the tomcat replacement below
192 sed -i -e "s@http://localhost:8888/flys/mapfish-print@https://localhost/flys-${VERSION}/flys/mapfish-print@g" \ 192 sed -i -e "s@http://localhost:8888/river/mapfish-print@https://localhost/flys-${VERSION}/river/mapfish-print@g" \
193 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/web.xml 193 $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/web.xml
194 194
195 sed -i -e "s@http://localhost:8181@http://localhost:$ARTIFACT_PORT@g" \ 195 sed -i -e "s@http://localhost:8181@http://localhost:$ARTIFACT_PORT@g" \
196 -e "s@http://localhost:8888@http://localhost:$TOMCAT_PORT@g" \ 196 -e "s@http://localhost:8888@http://localhost:$TOMCAT_PORT@g" \
197 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/web.xml 197 $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/web.xml
198 198
199 sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log@g" \ 199 sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log@g" \
200 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/log4j.properties 200 $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties
201 201
202 # XXX: Are they really used at runtime? 202 # XXX: Are they really used at runtime?
203 find $FLYS_SOURCE_DIR/flys/ -name \*.properties -o -name \*.xsl | \ 203 find $FLYS_SOURCE_DIR/river/ -name \*.properties -o -name \*.xsl | \
204 xargs sed -i "s@https://flys-intern.intevation.de@${WIKI_URL}@g"; 204 xargs sed -i "s@https://flys-intern.intevation.de@${WIKI_URL}@g";
205 205
206 sed -i -e "s@/usr/share/fonts/truetype/freefont@${FONT_PATH}@g" \ 206 sed -i -e "s@/usr/share/fonts/truetype/freefont@${FONT_PATH}@g" \
207 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/config.yaml 207 $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/config.yaml
208 208
209 if [ ! -f $FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz ]; then 209 if [ ! -f $FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz ]; then
210 echo "INFO: download OpenLayers-2.11 for client" 210 echo "INFO: download OpenLayers-2.11 for client"
211 cd $FLYS_SOURCE_DIR 211 cd $FLYS_SOURCE_DIR
212 curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz 212 curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz
215 rm -rf OpenLayers-2.11/doc 215 rm -rf OpenLayers-2.11/doc
216 rm -rf OpenLayers-2.11/tests 216 rm -rf OpenLayers-2.11/tests
217 rm -rf OpenLayers-2.11/examples 217 rm -rf OpenLayers-2.11/examples
218 cd $WORK_DIR 218 cd $WORK_DIR
219 fi 219 fi
220 cp -r $FLYS_SOURCE_DIR/OpenLayers-2.11 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/ 220 cp -r $FLYS_SOURCE_DIR/OpenLayers-2.11 $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/
221 221
222 echo "INFO: compile and build sources" 222 echo "INFO: compile and build sources"
223 mvn -f $FLYS_SOURCE_DIR/artifacts/pom.xml clean compile package install 223 mvn -f $FLYS_SOURCE_DIR/framework/pom.xml clean compile package install
224 mvn -f $FLYS_SOURCE_DIR/flys/flys-backend/pom.xml clean compile package install 224 mvn -f $FLYS_SOURCE_DIR/river/backend/pom.xml clean compile package install
225 mvn -f $FLYS_SOURCE_DIR/flys/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies install 225 mvn -f $FLYS_SOURCE_DIR/river/artifacts/pom.xml clean compile package dependency:copy-dependencies install
226 mvn -f $FLYS_SOURCE_DIR/http-client/pom.xml clean compile package install 226 mvn -f $FLYS_SOURCE_DIR/http-client/pom.xml clean compile package install
227 mvn -f $FLYS_SOURCE_DIR/flys/flys-client/pom.xml clean compile package 227 mvn -f $FLYS_SOURCE_DIR/river/gwt-client/pom.xml clean compile package
228 228
229 229
230 echo "INFO: copy dependencies and libs" 230 echo "INFO: copy dependencies and libs"
231 cp $FLYS_SOURCE_DIR/artifacts/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ 231 cp $FLYS_SOURCE_DIR/framework/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
232 cp $FLYS_SOURCE_DIR/artifacts/artifacts/target/artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ 232 cp $FLYS_SOURCE_DIR/framework/artifacts/target/artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
233 cp $FLYS_SOURCE_DIR/artifacts/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ 233 cp $FLYS_SOURCE_DIR/framework/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
234 cp $FLYS_SOURCE_DIR/flys/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ 234 cp $FLYS_SOURCE_DIR/river/backend/target/river-backend-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
235 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/ 235 cp $FLYS_SOURCE_DIR/river/artifacts/target/river-artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
236 cp $FLYS_SOURCE_DIR/flys/flys-client/target/FLYS-1.0-SNAPSHOT.war $WORK_DIR/client/flys-${VERSION}.war 236 cp $FLYS_SOURCE_DIR/river/gwt-client/target/gwt-client-1.0-SNAPSHOT.war $WORK_DIR/client/flys-${VERSION}.war
237 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/target/dependency/* $WORK_DIR/server/bin/lib/ 237 cp $FLYS_SOURCE_DIR/river/artifacts/target/dependency/* $WORK_DIR/server/bin/lib/
238 238
239 echo "INFO: copy scripts and libraries to target destination" 239 echo "INFO: copy scripts and libraries to target destination"
240 cp ${SCRIPT_DIR}/bin/run.sh $WORK_DIR/server/bin/ 240 cp ${SCRIPT_DIR}/bin/run.sh $WORK_DIR/server/bin/
241 cp ${SCRIPT_DIR}/bin/wsplgen.exe $WORK_DIR/server/bin/ 241 cp ${SCRIPT_DIR}/bin/wsplgen.exe $WORK_DIR/server/bin/
242 cp ${SCRIPT_DIR}/libs/* $WORK_DIR/server/bin/lib/ 242 cp ${SCRIPT_DIR}/libs/* $WORK_DIR/server/bin/lib/
263 rm -f $WORK_DIR/server/bin/lib/ojdbc* 263 rm -f $WORK_DIR/server/bin/lib/ojdbc*
264 fi 264 fi
265 265
266 # fetch the configuration stuff 266 # fetch the configuration stuff
267 echo "INFO: copy default configuration to target destination" 267 echo "INFO: copy default configuration to target destination"
268 cp -R $FLYS_SOURCE_DIR/flys/flys-artifacts/doc/conf $WORK_DIR/server/ 268 cp -R $FLYS_SOURCE_DIR/river/artifacts/doc/conf $WORK_DIR/server/
269 269
270 sed -i "s/8181/$ARTIFACT_PORT/g" \ 270 sed -i "s/8181/$ARTIFACT_PORT/g" \
271 $WORK_DIR/server/conf/rest-server.xml 271 $WORK_DIR/server/conf/rest-server.xml
272 272
273 sed -i -e "s@http://example.com/@${MAPSERVER_URL}/@g" \ 273 sed -i -e "s@http://example.com/@${MAPSERVER_URL}/@g" \
335 fi 335 fi
336 336
337 mkdir $WORK_DIR/artifactsdb 337 mkdir $WORK_DIR/artifactsdb
338 mkdir $WORK_DIR/datacagedb 338 mkdir $WORK_DIR/datacagedb
339 339
340 cp $FLYS_SOURCE_DIR/artifacts/artifact-database/doc/schema-h2.sql $WORK_DIR/artifactsdb/artifacts-h2.sql 340 cp $FLYS_SOURCE_DIR/framework/artifact-database/doc/schema-h2.sql $WORK_DIR/artifactsdb/artifacts-h2.sql
341 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/doc/conf/datacage.sql $WORK_DIR/datacagedb/datacage.sql 341 cp $FLYS_SOURCE_DIR/river/artifacts/doc/conf/datacage.sql $WORK_DIR/datacagedb/datacage.sql
342 342
343 echo "INFO: create h2 database for artifacts and datacage" 343 echo "INFO: create h2 database for artifacts and datacage"
344 $SCRIPT_DIR/h2/createArtifacts.sh $WORK_DIR/artifactsdb/artifacts-h2.sql 344 $SCRIPT_DIR/h2/createArtifacts.sh $WORK_DIR/artifactsdb/artifacts-h2.sql
345 $SCRIPT_DIR/h2/createDatacage.sh $WORK_DIR/datacagedb/datacage.sql 345 $SCRIPT_DIR/h2/createDatacage.sh $WORK_DIR/datacagedb/datacage.sql
346 346

http://dive4elements.wald.intevation.org