Mercurial > dive4elements > river
annotate contrib/make_flys_release/bin/make-importer-package.sh @ 5249:9c4e2192810c
Use default paths which are the same paths used when
the h2 database is created when by the contrib/h2/create* scripts.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 12 Mar 2013 16:49:16 +0100 |
parents | 29d79741c2fe |
children | 5422a798f105 |
rev | line source |
---|---|
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 #!/bin/bash |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
2 set -e |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 # See README for more information |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
6 # The working directory. Resulting tarball will be placed in the directory above. |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
7 PKG_DIR=/tmp/flys-importer |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 # Default conf |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 CONF_DIR=/path/to/conf/dir |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 # Path to the flys checkout |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 FLYS_DIR=/path/to/flys/root |
5179
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
12 # Tarball that will be extracted into flys-imprter/opt |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
13 EXTRAS=$1 |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 rm -fr $PKG_DIR |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 mkdir -p $PKG_DIR/hydr_morph |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 mkdir -p $PKG_DIR/geodaesie |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 mkdir -p $PKG_DIR/opt/lib64 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 mkdir -p $PKG_DIR/schema |
5179
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
20 mkdir -p $PKG_DIR/conf |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
21 |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
22 cat > "$PKG_DIR/conf/log4j.properties" << "EOF" |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
23 log4j.rootLogger=DEBUG, IMPORTER |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
24 log4j.appender.IMPORTER.layout=org.apache.log4j.PatternLayout |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
25 log4j.appender.IMPORTER.layout.ConversionPattern=%d [%t] %-5p %c - %m%n |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
26 log4j.appender.IMPORTER=org.apache.log4j.RollingFileAppender |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
27 log4j.appender.IMPORTER.File=./import.log |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
28 log4j.appender.IMPORTER.MaxFileSize=100000KB |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
29 log4j.appender.IMPORTER.MaxBackupIndex=10 |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
30 EOF |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
31 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
32 cd ${FLYS_DIR}/flys-backend |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
33 mvn -f pom-oracle.xml clean compile assembly:single |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 cp target/flys-backend-1.0-SNAPSHOT-jar-with-dependencies.jar \ |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
35 $PKG_DIR/hydr_morph/importer.jar |
5172
a51515056c45
Package postgresql importer and import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
5163
diff
changeset
|
36 mvn -f pom.xml clean compile assembly:single |
a51515056c45
Package postgresql importer and import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
5163
diff
changeset
|
37 cp target/flys-backend-1.0-SNAPSHOT-jar-with-dependencies.jar \ |
a51515056c45
Package postgresql importer and import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
5163
diff
changeset
|
38 $PKG_DIR/hydr_morph/importer_psql.jar |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
39 cp ${FLYS_DIR}/flys-backend/contrib/shpimporter/*.py $PKG_DIR/geodaesie |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
40 cp ${FLYS_DIR}/flys-backend/contrib/run_geo.sh \ |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
41 ${FLYS_DIR}/flys-backend/contrib/run_hydr_morph.sh \ |
5172
a51515056c45
Package postgresql importer and import_river script
Andre Heinecke <aheinecke@intevation.de>
parents:
5163
diff
changeset
|
42 ${FLYS_DIR}/flys-backend/contrib/import_river.sh \ |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
43 $PKG_DIR |
5163
9474e27e319a
Use annotation-types.xml from flys-backend sources
Andre Heinecke <aheinecke@intevation.de>
parents:
5097
diff
changeset
|
44 cp ${FLYS_DIR}/flys-backend/doc/annotation-types.xml $PKG_DIR/conf |
5199
29d79741c2fe
Fix quoting of EXTRAS in packaging script
Andre Heinecke <aheinecke@intevation.de>
parents:
5186
diff
changeset
|
45 if [ -f "$EXTRAS" ]; then |
5179
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
46 cd $PKG_DIR |
5199
29d79741c2fe
Fix quoting of EXTRAS in packaging script
Andre Heinecke <aheinecke@intevation.de>
parents:
5186
diff
changeset
|
47 tar -xzf "$EXTRAS" |
5179
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
48 fi |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
49 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
50 cp ${FLYS_DIR}/flys-backend/doc/schema/*.sql $PKG_DIR/schema |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
51 cp ${FLYS_DIR}/flys-backend/doc/documentation/de/importer-manual.pdf $PKG_DIR |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
52 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
53 sed -i 's/shpimporter\/shp/geodaesie\/shp/' $PKG_DIR/run_geo.sh |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
55 cd $PKG_DIR/.. |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
56 DATE=$(date +%Y%m%d%H%m) |
5179
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
57 tar -czf flys-importer_${DATE}.tar.gz flys-importer |
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
58 sha1sum flys-importer_${DATE}.tar.gz > flys-importer_${DATE}.tar.gz.sha1 |
5186
801866a89ee0
Fix syntax error in importer packaging script
Andre Heinecke <aheinecke@intevation.de>
parents:
5179
diff
changeset
|
59 echo Package is at: `readlink -f flys-importer_${DATE}.tar.gz` |