ingo@4065: #!/bin/sh ingo@4065: HG_USER=YOURNAME ingo@4065: ingo@4065: echo "INFO: define required variables" ingo@4065: ARTIFACTS_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/artifacts" ingo@4065: HTTPCLIIENT_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/http-client" ingo@4065: FLYS_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/flys" ingo@4065: ingo@4065: ARTIFACTS_HG="hg.artifacts" ingo@4065: HTTPCLIENT_HG="hg.http-client" ingo@4065: FLYS_HG="hg.flys" ingo@4065: ingo@4065: PREFIX="flys-" teichmann@4151: RELEASE=default teichmann@4151: RELEASE_DATE=`date +'%Y-%m-%d'` teichmann@4151: DIRECTORY=$PREFIX$RELEASE_DATE ingo@4065: ingo@4065: echo "INFO: create server directories" teichmann@4151: mkdir -p $DIRECTORY/server/bin/lib/own ingo@4065: mkdir $DIRECTORY/server/shapefiles ingo@4065: mkdir $DIRECTORY/client ingo@4065: ingo@4065: echo "INFO: checkout sources" ingo@4065: echo " ... checkout $ARTIFACTS_HG_REPO" ingo@4065: hg clone $ARTIFACTS_HG_REPO $ARTIFACTS_HG ingo@4065: (cd $ARTIFACTS_HG && hg co $RELEASE) ingo@4065: ingo@4065: echo " ... checkout $HTTPCLIIENT_HG_REPO" ingo@4065: hg clone $HTTPCLIIENT_HG_REPO $HTTPCLIENT_HG ingo@4065: (cd $HTTPCLIENT_HG && hg co $RELEASE) ingo@4065: ingo@4065: echo " ... checkout $FLYS_HG_REPO" ingo@4065: hg clone $FLYS_HG_REPO $FLYS_HG ingo@4065: (cd $FLYS_HG && hg co $RELEASE) ingo@4065: ingo@4065: # adapt client configuration ingo@4065: echo "INFO: prepare configuration of web client" ingo@4065: cp confs/web.xml $FLYS_HG/flys-client/src/main/webapp/WEB-INF/web.xml ingo@4065: ingo@4065: echo "INFO: download OpenLayers-2.11 for client" ingo@4065: curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz ingo@4065: tar xvfz OpenLayers-2.11.tar.gz teichmann@4151: # TODO: Remove more superfluous OpenLayers stuff. teichmann@4151: rm -rf OpenLayers-2.11/doc teichmann@4151: rm -rf OpenLayers-2.11/tests teichmann@4151: rm -rf OpenLayers-2.11/examples ingo@4065: mv OpenLayers-2.11 $FLYS_HG/flys-client/src/main/webapp/ ingo@4065: ingo@4065: # compile and build our code stuff ingo@4065: echo "INFO: compile and build sources" ingo@4065: mvn -f $ARTIFACTS_HG/pom.xml clean compile package ingo@4065: mvn -f $FLYS_HG/flys-backend/pom.xml clean compile package ingo@4065: mvn -f $FLYS_HG/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies ingo@4065: mvn -f $HTTPCLIENT_HG/pom.xml clean compile package install ingo@4065: mvn -f $FLYS_HG/flys-client/pom.xml clean compile package ingo@4065: ingo@4065: ## fetch the java stuff ingo@4065: echo "INFO: copy dependencies and libs" ingo@4065: cp $ARTIFACTS_HG/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ ingo@4065: cp $ARTIFACTS_HG/artifacts/target/artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ ingo@4065: cp $ARTIFACTS_HG/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ ingo@4065: cp $FLYS_HG/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ ingo@4065: cp $FLYS_HG/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/ ingo@4065: cp $FLYS_HG/flys-client/target/FLYS-1.0-SNAPSHOT.war $DIRECTORY/client/ ingo@4065: cp $FLYS_HG/flys-artifacts/target/dependency/* $DIRECTORY/server/bin/lib/ ingo@4065: ingo@4065: echo "INFO: copy scripts and libraries to target destination" ingo@4065: cp bin/run.sh $DIRECTORY/server/bin/ ingo@4065: cp bin/wsplgen.exe $DIRECTORY/server/bin/ ingo@4065: cp libs/* $DIRECTORY/server/bin/lib/ ingo@4065: ingo@4065: #echo "INFO: remove PostgreSQL and PostGIS libraries" ingo@4065: #rm $DIRECTORY/server/bin/lib/postg* ingo@4065: #rm $DIRECTORY/server/bin/lib/hibernate-spatial-postgis* ingo@4065: ingo@4065: echo "INFO: remove Oralce libraries" ingo@4065: rm $DIRECTORY/server/bin/lib/hibernate-spatial-oracle-1.1.jar ingo@4065: rm $DIRECTORY/server/bin/lib/ojdbc* ingo@4065: ingo@4065: # fetch the configuration stuff ingo@4065: echo "INFO: copy default configuration to target destination" ingo@4065: cp -R $FLYS_HG/flys-artifacts/doc/conf $DIRECTORY/server/ ingo@4065: cp confs/* $DIRECTORY/server/conf/ ingo@4065: ingo@4065: cp $ARTIFACTS_HG/artifact-database/doc/schema-h2.sql h2/artifacts-h2.sql ingo@4065: cp $FLYS_HG/flys-artifacts/doc/conf/datacage.sql h2/datacage.sql ingo@4065: ingo@4065: echo "INFO: create h2 database for artifacts and datacage" ingo@4065: h2/createArtifacts.sh ingo@4065: h2/createDatacage.sh ingo@4065: ingo@4065: mv artifactsdb $DIRECTORY/server/ ingo@4065: mv datacagedb $DIRECTORY/server/ ingo@4065: ingo@4065: echo "INFO: create tarball" ingo@4065: tar cvfz $DIRECTORY.tar.gz $DIRECTORY ingo@4065: ingo@4065: echo "INFO: remove temporary files and directories" ingo@4065: rm -rf $ARTIFACTS_HG ingo@4065: rm -rf $HTTPCLIENT_HG ingo@4065: rm -rf $FLYS_HG ingo@4065: rm -rf $DIRECTORY ingo@4065: rm -rf OpenLayers.2.11.tar.gz