Mercurial > dive4elements > river
annotate contrib/make_flys_release/bin/make-importer-package.sh @ 9751:308a0d822d18 3.2.x
Keep configuration and data in distinct directories
This allows having distinct volumes for configuration and data
(artifact database, generated mapfiles and shapefiles, etc.).
While at it, cleanup MapServer configuration a little bit.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 11 Oct 2022 11:42:09 +0200 |
parents | b1b48fa7bd80 |
children | b57b236c4f4e |
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 |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
2 # Packaging-script for Dive4Elements River-Importer |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
3 # |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
4 # Copyright (C) 2011 - 2014 by Bundesanstalt für Gewässerkunde |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
5 # Software engineering by Intevation GmbH |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
6 # |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
7 # This file is Free Software under the GNU AGPL (>=v3) |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
8 # and comes with ABSOLUTELY NO WARRANTY! Check out the |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
9 # documentation coming with Dive4Elements River for details. |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
10 |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 set -e |
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
13 # See ../README for more information |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
14 # The working directory. Resulting tarball will be placed here. |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
15 PKG_DIR=/tmp/flys-importer |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 # Path to the flys checkout |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
17 SOURCE_DIR=$(readlink -f `dirname $0`)/../../.. |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
19 usage(){ |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
20 cat << EOF |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
21 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
22 usage: $0 [options] VERSION [EXTRAS] |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
23 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
24 Create a D4E River Importer-package |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
25 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
26 OPTIONS: |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
27 -?, --help Show this message |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
28 VERSION must specify a tag (usually MAYOR.MINOR.PATCH) or a branch name. |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
29 With EXTRAS, a tarball with dependencies can be given. |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
30 EOF |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
31 exit 0 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
32 } |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
33 |
9744
b1b48fa7bd80
Include both database drivers in one pom.xml
Tom Gottfried <tom@intevation.de>
parents:
9719
diff
changeset
|
34 OPTS=`getopt -o ? -l help -n $0 -- "$@"` |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
35 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
36 if [ $? != 0 ] ; then usage; fi |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
37 eval set -- "$OPTS" |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
38 while true ; do |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
39 case "$1" in |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
40 "-?"|"--help") |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
41 usage;; |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
42 "--") |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
43 shift |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
44 break;; |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
45 *) |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
46 echo "Unknown Option $1" |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
47 usage;; |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
48 esac |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
49 done |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
50 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
51 if [ $# != 1 ]; then |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
52 usage |
5179
4355b4cecef8
Improve importer packaging by just expecting a tarball with
Andre Heinecke <aheinecke@intevation.de>
parents:
5172
diff
changeset
|
53 fi |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
55 VERSION=$1 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
56 EXTRAS=$2 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
57 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
58 # Update to VERSION |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
59 echo "WARNING: any local changes in $SOURCE_DIR will be packaged." |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
60 cd ${SOURCE_DIR} |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
61 if [ -z "`hg tags | sed -n "/$VERSION/p"`" -a -z "`hg branches | sed -n "/$VERSION/p"`" ] |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
62 then |
8742
f7007b1aaa3f
Importer-packaging: just a warning would end up with a package that really looks like VERSION.
Tom Gottfried <tom@intevation.de>
parents:
8675
diff
changeset
|
63 echo "ERROR: No tag or branch $VERSION found in repository of $repo!" |
f7007b1aaa3f
Importer-packaging: just a warning would end up with a package that really looks like VERSION.
Tom Gottfried <tom@intevation.de>
parents:
8675
diff
changeset
|
64 exit 1 |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
65 else |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
66 hg up "$VERSION" |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
67 fi |
5520
d5e1e4d9559e
compile manual from within importer packaging script
Tom Gottfried <tom.gottfried@intevation.de>
parents:
5491
diff
changeset
|
68 |
6814
e41059fb4073
Importer Doc: Update title page automatically.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
5855
diff
changeset
|
69 # create PDF of manual |
7334
f7d3fc619976
Importer manual: use unique revision identifier.
Tom Gottfried <tom@intevation.de>
parents:
7331
diff
changeset
|
70 REV=`hg parent | sed -n '1s/[[:alnum:]]*: *\([0-9]*:.*\)/\1/;1p'` |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
71 cd ${SOURCE_DIR}/backend/doc/documentation/de/ |
7334
f7d3fc619976
Importer manual: use unique revision identifier.
Tom Gottfried <tom@intevation.de>
parents:
7331
diff
changeset
|
72 sed -i "s/documentrevision..rev.*/documentrevision}{rev$REV}/" \ |
6814
e41059fb4073
Importer Doc: Update title page automatically.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
5855
diff
changeset
|
73 importer-manual.tex |
7331
bb9735fbb680
Importer packaging: run pdflatex three times to get references and page numbering right.
Tom Gottfried <tom@intevation.de>
parents:
6814
diff
changeset
|
74 # run pdflatex three times to get references and page numbering right |
bb9735fbb680
Importer packaging: run pdflatex three times to get references and page numbering right.
Tom Gottfried <tom@intevation.de>
parents:
6814
diff
changeset
|
75 pdflatex importer-manual.tex |
bb9735fbb680
Importer packaging: run pdflatex three times to get references and page numbering right.
Tom Gottfried <tom@intevation.de>
parents:
6814
diff
changeset
|
76 pdflatex importer-manual.tex |
6814
e41059fb4073
Importer Doc: Update title page automatically.
Tom Gottfried <tom.gottfried@intevation.de>
parents:
5855
diff
changeset
|
77 pdflatex importer-manual.tex |
5097
415ac9bc5a56
Add importer packaging script and some doc about it
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
78 |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
79 # package importer |
9744
b1b48fa7bd80
Include both database drivers in one pom.xml
Tom Gottfried <tom@intevation.de>
parents:
9719
diff
changeset
|
80 mvn -f $SOURCE_DIR/backend/pom.xml clean package assembly:single |
8675
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
81 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
82 echo "INFO: create tarball" |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
83 rm -fr $PKG_DIR |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
84 mkdir $PKG_DIR |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
85 cd $PKG_DIR |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
86 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
87 mv $SOURCE_DIR/backend/target/river-backend-1.0-SNAPSHOT*-flys-importer.tar \ |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
88 flys-importer-$VERSION.tar |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
89 if [ -f "$EXTRAS" ]; then |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
90 tar -xzf "$EXTRAS" |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
91 tar -rf flys-importer-$VERSION.tar opt |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
92 fi |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
93 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
94 gzip flys-importer-$VERSION.tar |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
95 sha1sum flys-importer-$VERSION.tar.gz > flys-importer-$VERSION.tar.gz.sha1 |
ae3df0f96e15
Mavenize importer packaging and allow packaging for specific versions and database systems.
Tom Gottfried <tom@intevation.de>
parents:
8670
diff
changeset
|
96 echo Package is at: `readlink -f flys-importer-$VERSION.tar.gz` |