comparison 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
comparison
equal deleted inserted replaced
4064:61020a61ed38 4065:9d404069f361
1 #!/bin/sh
2 HG_USER=YOURNAME
3
4 echo "INFO: define required variables"
5 ARTIFACTS_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/artifacts"
6 HTTPCLIIENT_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/http-client"
7 FLYS_HG_REPO="ssh://$HG_USER@hg.wald.intevation.org/hg/dive4elements/flys"
8
9 ARTIFACTS_HG="hg.artifacts"
10 HTTPCLIENT_HG="hg.http-client"
11 FLYS_HG="hg.flys"
12
13 PREFIX="flys-"
14 RELEASE="default"
15 DIRECTORY=$PREFIX$RELEASE
16
17 echo "INFO: create server directories"
18 mkdir $DIRECTORY
19 mkdir $DIRECTORY/server
20 mkdir $DIRECTORY/server/bin
21 mkdir $DIRECTORY/server/bin/lib
22 mkdir $DIRECTORY/server/bin/lib/own
23 mkdir $DIRECTORY/server/shapefiles
24 mkdir $DIRECTORY/client
25
26 echo "INFO: checkout sources"
27 echo " ... checkout $ARTIFACTS_HG_REPO"
28 hg clone $ARTIFACTS_HG_REPO $ARTIFACTS_HG
29 (cd $ARTIFACTS_HG && hg co $RELEASE)
30
31 echo " ... checkout $HTTPCLIIENT_HG_REPO"
32 hg clone $HTTPCLIIENT_HG_REPO $HTTPCLIENT_HG
33 (cd $HTTPCLIENT_HG && hg co $RELEASE)
34
35 echo " ... checkout $FLYS_HG_REPO"
36 hg clone $FLYS_HG_REPO $FLYS_HG
37 (cd $FLYS_HG && hg co $RELEASE)
38
39 # adapt client configuration
40 echo "INFO: prepare configuration of web client"
41 cp confs/web.xml $FLYS_HG/flys-client/src/main/webapp/WEB-INF/web.xml
42
43 echo "INFO: download OpenLayers-2.11 for client"
44 curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz
45 tar xvfz OpenLayers-2.11.tar.gz
46 mv OpenLayers-2.11 $FLYS_HG/flys-client/src/main/webapp/
47
48 # compile and build our code stuff
49 echo "INFO: compile and build sources"
50 mvn -f $ARTIFACTS_HG/pom.xml clean compile package
51 mvn -f $FLYS_HG/flys-backend/pom.xml clean compile package
52 mvn -f $FLYS_HG/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies
53 mvn -f $HTTPCLIENT_HG/pom.xml clean compile package install
54 mvn -f $FLYS_HG/flys-client/pom.xml clean compile package
55
56 ## fetch the java stuff
57 echo "INFO: copy dependencies and libs"
58 cp $ARTIFACTS_HG/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
59 cp $ARTIFACTS_HG/artifacts/target/artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
60 cp $ARTIFACTS_HG/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
61 cp $FLYS_HG/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
62 cp $FLYS_HG/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $DIRECTORY/server/bin/lib/own/
63 cp $FLYS_HG/flys-client/target/FLYS-1.0-SNAPSHOT.war $DIRECTORY/client/
64 cp $FLYS_HG/flys-artifacts/target/dependency/* $DIRECTORY/server/bin/lib/
65
66 echo "INFO: copy scripts and libraries to target destination"
67 cp bin/run.sh $DIRECTORY/server/bin/
68 cp bin/wsplgen.exe $DIRECTORY/server/bin/
69 cp libs/* $DIRECTORY/server/bin/lib/
70
71 #echo "INFO: remove PostgreSQL and PostGIS libraries"
72 #rm $DIRECTORY/server/bin/lib/postg*
73 #rm $DIRECTORY/server/bin/lib/hibernate-spatial-postgis*
74
75 echo "INFO: remove Oralce libraries"
76 rm $DIRECTORY/server/bin/lib/hibernate-spatial-oracle-1.1.jar
77 rm $DIRECTORY/server/bin/lib/ojdbc*
78
79 # fetch the configuration stuff
80 echo "INFO: copy default configuration to target destination"
81 cp -R $FLYS_HG/flys-artifacts/doc/conf $DIRECTORY/server/
82 cp confs/* $DIRECTORY/server/conf/
83
84 cp $ARTIFACTS_HG/artifact-database/doc/schema-h2.sql h2/artifacts-h2.sql
85 cp $FLYS_HG/flys-artifacts/doc/conf/datacage.sql h2/datacage.sql
86
87 echo "INFO: create h2 database for artifacts and datacage"
88 h2/createArtifacts.sh
89 h2/createDatacage.sh
90
91 mv artifactsdb $DIRECTORY/server/
92 mv datacagedb $DIRECTORY/server/
93
94 echo "INFO: create tarball"
95 tar cvfz $DIRECTORY.tar.gz $DIRECTORY
96
97 echo "INFO: remove temporary files and directories"
98 rm -rf $ARTIFACTS_HG
99 rm -rf $HTTPCLIENT_HG
100 rm -rf $FLYS_HG
101 rm -rf $DIRECTORY
102 rm -rf OpenLayers.2.11.tar.gz

http://dive4elements.wald.intevation.org