diff contrib/make_flys_release/make_release.sh @ 4065:9d404069f361

Added build script for FLYS release.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 09 Oct 2012 12:30:13 +0200
parents
children 0182916dcb01
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/make_flys_release/make_release.sh	Tue Oct 09 12:30:13 2012 +0200
@@ -0,0 +1,102 @@
+#!/bin/sh
+HG_USER=YOURNAME
+
+echo "INFO: define required variables"
+ARTIFACTS_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/artifacts"
+HTTPCLIIENT_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/http-client"
+FLYS_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/flys"
+
+ARTIFACTS_HG="hg.artifacts"
+HTTPCLIENT_HG="hg.http-client"
+FLYS_HG="hg.flys"
+
+PREFIX="flys-"
+RELEASE="default"
+DIRECTORY=$PREFIX$RELEASE
+
+echo "INFO: create server directories"
+mkdir $DIRECTORY
+mkdir $DIRECTORY/server
+mkdir $DIRECTORY/server/bin
+mkdir $DIRECTORY/server/bin/lib
+mkdir $DIRECTORY/server/bin/lib/own
+mkdir $DIRECTORY/server/shapefiles
+mkdir $DIRECTORY/client
+
+echo "INFO: checkout sources"
+echo " ... checkout $ARTIFACTS_HG_REPO"
+hg clone $ARTIFACTS_HG_REPO $ARTIFACTS_HG
+(cd $ARTIFACTS_HG && hg co $RELEASE)
+
+echo " ... checkout $HTTPCLIIENT_HG_REPO"
+hg clone $HTTPCLIIENT_HG_REPO $HTTPCLIENT_HG
+(cd $HTTPCLIENT_HG && hg co $RELEASE)
+
+echo " ... checkout $FLYS_HG_REPO"
+hg clone $FLYS_HG_REPO $FLYS_HG
+(cd $FLYS_HG && hg co $RELEASE)
+
+# adapt client configuration
+echo "INFO: prepare configuration of web client"
+cp confs/web.xml $FLYS_HG/flys-client/src/main/webapp/WEB-INF/web.xml
+
+echo "INFO: download OpenLayers-2.11 for client"
+curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz
+tar xvfz OpenLayers-2.11.tar.gz
+mv OpenLayers-2.11 $FLYS_HG/flys-client/src/main/webapp/
+
+# compile and build our code stuff
+echo "INFO: compile and build sources"
+mvn -f $ARTIFACTS_HG/pom.xml clean compile package
+mvn -f $FLYS_HG/flys-backend/pom.xml clean compile package
+mvn -f $FLYS_HG/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies
+mvn -f $HTTPCLIENT_HG/pom.xml clean compile package install
+mvn -f $FLYS_HG/flys-client/pom.xml clean compile package
+
+## fetch the java stuff
+echo "INFO: copy dependencies and libs"
+cp $ARTIFACTS_HG/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
+cp $ARTIFACTS_HG/artifacts/target/artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
+cp $ARTIFACTS_HG/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
+cp $FLYS_HG/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
+cp $FLYS_HG/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
+cp $FLYS_HG/flys-client/target/FLYS-1.0-SNAPSHOT.war $DIRECTORY/client/
+cp $FLYS_HG/flys-artifacts/target/dependency/* $DIRECTORY/server/bin/lib/
+
+echo "INFO: copy scripts and libraries to target destination"
+cp bin/run.sh $DIRECTORY/server/bin/
+cp bin/wsplgen.exe $DIRECTORY/server/bin/
+cp libs/* $DIRECTORY/server/bin/lib/
+
+#echo "INFO: remove PostgreSQL and PostGIS libraries"
+#rm $DIRECTORY/server/bin/lib/postg*
+#rm $DIRECTORY/server/bin/lib/hibernate-spatial-postgis*
+
+echo "INFO: remove Oralce libraries"
+rm $DIRECTORY/server/bin/lib/hibernate-spatial-oracle-1.1.jar
+rm $DIRECTORY/server/bin/lib/ojdbc*
+
+# fetch the configuration stuff
+echo "INFO: copy default configuration to target destination"
+cp -R $FLYS_HG/flys-artifacts/doc/conf $DIRECTORY/server/
+cp confs/* $DIRECTORY/server/conf/
+
+cp $ARTIFACTS_HG/artifact-database/doc/schema-h2.sql h2/artifacts-h2.sql
+cp $FLYS_HG/flys-artifacts/doc/conf/datacage.sql h2/datacage.sql
+
+echo "INFO: create h2 database for artifacts and datacage"
+h2/createArtifacts.sh
+h2/createDatacage.sh
+
+mv artifactsdb $DIRECTORY/server/
+mv datacagedb $DIRECTORY/server/
+
+echo "INFO: create tarball"
+tar cvfz $DIRECTORY.tar.gz $DIRECTORY
+
+echo "INFO: remove temporary files and directories"
+rm -rf $ARTIFACTS_HG
+rm -rf $HTTPCLIENT_HG
+rm -rf $FLYS_HG
+rm -rf $DIRECTORY
+rm -rf OpenLayers.2.11.tar.gz

http://dive4elements.wald.intevation.org