view contrib/make_flys_release/make_release.sh @ 4431:83fe6eeba83a

Added vim line.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 07 Nov 2012 09:44:24 +0100
parents 0182916dcb01
children 7e82d51c5a27
line wrap: on
line source
#!/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
RELEASE_DATE=`date +'%Y-%m-%d'`
DIRECTORY=$PREFIX$RELEASE_DATE

echo "INFO: create server directories"
mkdir -p $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
# TODO: Remove more superfluous OpenLayers stuff.
rm -rf OpenLayers-2.11/doc
rm -rf OpenLayers-2.11/tests
rm -rf OpenLayers-2.11/examples
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