annotate contrib/make_flys_release/make_release.sh @ 5476:f9eee1909e6e

Fix null pointer exception in ImportMeasurement Station Range may be null
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 27 Mar 2013 17:49:46 +0100
parents 485ff339661e
children 2be02d6ad9dc
rev   line source
4484
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
1 #!/bin/bash
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
2 # Release script for Flys
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
3 #
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
4 # Authors:
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
5 # Andre Heinecke <aheinecke@intevation.de>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
6 #
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
7 # Copyright:
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
8 # Copyright (C) 2013 Intevation GmbH
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
9 #
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
10 # This program is free software; you can redistribute it and/or
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
11 # modify it under the terms of the GNU General Public License
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
12 # as published by the Free Software Foundation; either version 2
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
13 # of the License, or (at your option) any later version.
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
14 #
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
15 # This program is distributed in the hope that it will be useful,
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
18 # GNU General Public License for more details.
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
19 #
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
20 # You should have received a copy of the GNU General Public License
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
21 # along with this program; if not, write to the Free Software
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
5220
613d2f494728 Handle return codes in the make_flys_release script
Andre Heinecke <aheinecke@intevation.de>
parents: 5119
diff changeset
24 set -e
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
25 DEFAULT_WD=/tmp/flys-release
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
26 DEVELOPER=aheinecke
5220
613d2f494728 Handle return codes in the make_flys_release script
Andre Heinecke <aheinecke@intevation.de>
parents: 5119
diff changeset
27
4484
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
28 ARTIFACTS_HG_REPO="http://wald.intevation.org/hg/dive4elements/artifacts"
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
29 HTTPCLIIENT_HG_REPO="http://wald.intevation.org/hg/dive4elements/http-client"
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
30 FLYS_HG_REPO="http://wald.intevation.org/hg/dive4elements/flys"
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
32 REPOS="artifacts http-client flys"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
33 # Do not use spaces in path
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
34 FLYS_SOURCE_DIR=/local-vol1/aheinecke/flys-release
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
36 ORACLE_HIBERNATE=$FLYS_SOURCE_DIR/hibernate-spatial-oracle-1.1.jar
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
37 ORACLE_JDBC=$FLYS_SOURCE_DIR/ojdbc5.jar
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
38
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
39 SCRIPT_DIR=$(readlink -f `dirname $0`)
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
40 usage(){
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
41 cat << EOF
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
43 usage: $0 [options] VERSION
4484
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
44
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
45 Create a flys package
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
46
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
47 OPTIONS:
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
48 -?, --help Show this message
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
49 -w The working directory to use. (do not use spaces in path)
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
50 Default: $DEFAULT_WD
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
51 -t Tag the current default branch as "VERSION"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
52 -o, --oracle Release is for oracle.
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
53 VERSION must be in the format MAYOR.MINOR.PATCH
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
54 EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
55 exit 0
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
56 }
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
57 # --backend-db-url Url of database backend. Default: $BACKENDURL
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
58 # --backend-db-pass Backend db password. Default: $BACKENDPASS
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
59 # --backend-db-port Backend db port. Default: $BACKENDPORT
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
60 # --backend-db-user Backend db user. Default: $BACKENDUSER
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
61 # --backend-db-backend Backend db backend name. Default: $BACKENDBACK
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
62 # --seddb-url Sediment db url. Default: $SEDDBURL
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
63 # --seddb-port Sediment db port. Default: $SEDDBPORT
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
64 # --seddb-user Sediment db user. Default: $SEDDBUSER
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
65 # --seddb-pass Sediment db password. Default: $SEDDBPASS
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
66 # --seddb-back Sediment db backend. Default: $SEDDBBACK
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
67 TOMCAT_PORT=${TOMCAT_PORT:-8282}
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
68 MAPSERVER_URL=${MAPSERVER_URL:-flys-devel.intevation.de}
5119
15ff9ddc765e Patch WIKI urls during release building
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4889
diff changeset
69 WIKI_URL=${WIKI_URL:-https://flys-intern.intevation.de/Flys-3.0}
4494
334c68344eb5 Fix hard coded mapserver url
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4493
diff changeset
70
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
71 # Seddb Configuration
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
72 SEDDBURL=${SEDDBURL:-czech-republic.atlas.intevation.de}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
73 SEDDBPORT=${SEDDBPORT:-1521}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
74 SEDDBBACK=${SEDDBBACK:-XE}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
75 SEDDBUSER=${SEDDBUSER:-seddb}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
76 SEDDBPASS=${SEDDBPASS:-seddbpass}
5418
485ff339661e Add sedinitsqls to packaging script
Andre Heinecke <aheinecke@intevation.de>
parents: 5383
diff changeset
77 SEDINITSQLS=${SEDINITSQLS:-}
485ff339661e Add sedinitsqls to packaging script
Andre Heinecke <aheinecke@intevation.de>
parents: 5383
diff changeset
78
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
80 # Backend configuration
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
81 BACKENDURL=${BACKENDURL:-czech-republic.atlas.intevation.de}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
82 BACKENDPORT=${BACKENDPORT:-5432}
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
83 BACKENDBACK=${BACKENDBACK:-flys_2913}
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
84 BACKENDUSER=${BACKENDUSER:-flys_dami}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
85 BACKENDPASS=${BACKENDPASS:-flys_dami}
5255
f890d315240f Fix oracle backend configuration and allow INITSQLS statement
Andre Heinecke <aheinecke@intevation.de>
parents: 5254
diff changeset
86 INITSQLS=${INITSQLS:-}
5268
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
87 LOG_DIR=/var/log/flys
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
89 OPTS=`getopt -o ?w:,t,o \
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
90 -l help,oracle \
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
91 -n $0 -- "$@"`
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
93 if [ $? != 0 ] ; then usage; fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
94 eval set -- "$OPTS"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
95 while true ; do
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
96 case "$1" in
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
97 "-?"|"--help")
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
98 usage;;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
99 "--")
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
100 shift
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
101 break;;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
102 "-w")
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
103 WORK_DIR=$2
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
104 shift 2;;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
105 "-o"|"--oracle")
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
106 BUILD_ORACLE="TRUE"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
107 shift;;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
108 "-t")
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
109 DO_TAG="TRUE"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
110 shift;;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
111 *)
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
112 echo "Unknown Option $1"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
113 usage;;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
114 esac
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
115 done
4484
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
116
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
117 if [ $# != 1 ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
118 usage
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
119 fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
120
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
121 VERSION=$1
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
122 ARTIFACT_PORT=${ARTIFACT_PORT:-`echo 1$VERSION | sed 's/\.//g'`}
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
123
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
124 if [ -z $WORK_DIR ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
125 WORK_DIR=$DEFAULT_WD
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
126 fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
127
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
128 mkdir -p $WORK_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
129
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
130 if [ ! -d $FLYS_SOURCE_DIR ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
131 mkdir -p $FLYS_SOURCE_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
132 echo "Cloning sources"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
133 cd $FLYS_SOURCE_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
134 hg clone $ARTIFACTS_HG_REPO artifacts
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
135 hg clone $HTTPCLIIENT_HG_REPO http-client
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
136 hg clone $FLYS_HG_REPO flys
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
137 else
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
138 echo "Updating sources / Reverting changes"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
139 cd $FLYS_SOURCE_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
140 for repo in $REPOS; do
5383
c841eac48474 First revert then update in the make release script to avoid conflicts
Andre Heinecke <aheinecke@intevation.de>
parents: 5325
diff changeset
141 cd $repo && hg pull && hg revert -a && hg up && cd $FLYS_SOURCE_DIR
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
142 done;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
143 fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
144
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
145 if [ "$DO_TAG" = "TRUE" ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
146 echo "Tagging version $VERSION"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
147 for repo in $REPOS; do
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
148 cd $repo
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
149 CHANGESET=$(hg log -l1 |head -1 | awk -F: '{print $3}')
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
150 echo ""
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
151 echo "Do you really want to tag $repo rev: $CHANGESET as Version $VERSION?"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
152 echo "press enter to continue or CTRL+C to abort."
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
153 echo ""
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
154 hg log -l1
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
155 read
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
156 OLD_REV=$(cat .hgtags | tail -1 | awk '{print $2}')
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
157 hg tag $VERSION -m "Added tag $VERSION for changeset $CHANGESET"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
158 hg push ssh://$DEVELOPER@scm.wald.intevation.org/hg/dive4elements/$repo
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
159 echo "Changelog for $repo" >> $WORK_DIR/changes_$OLD_REV-$VERSION.txt
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
160 echo "#############################################################################" \
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
161 >> $WORK_DIR/changes_$OLD_REV-$VERSION.txt
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
162 hg log -r $VERSION:$OLD_REV --style changelog >> $WORK_DIR/changes_$OLD_REV-$VERSION.txt
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
163 cd $FLYS_SOURCE_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
164 done;
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
165 fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
166
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
167 # Update to current version
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
168 for repo in $REPOS; do
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
169 cd $repo
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
170 hg up $VERSION
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
171 cd $FLYS_SOURCE_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
172 done
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
173
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
174 rm -rf "$WORK_DIR/server" "$WORK_DIR/client"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
175 cd $WORK_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
176 mkdir -p "$WORK_DIR/server/bin/lib/own"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
177 mkdir "$WORK_DIR/server/shapefiles"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
178 mkdir "$WORK_DIR/client"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
179
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
180 echo "[INFO]: Preparing configuration of web client"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
181 echo "[INFO]: Tomcat Port: $TOMCAT_PORT"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
182 echo "[INFO]: Artifact Port: $ARTIFACT_PORT"
4503
f91260ccef03 Fixed typo in make_release script.
Raimund Renkert <rrenkert@intevation.de>
parents: 4494
diff changeset
183 sed -i -e "s@http://localhost:8181@http://localhost:$ARTIFACT_PORT@g" \
4487
a08d25476f0a Fixed web.xml seding
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4485
diff changeset
184 -e "s@http://localhost:8888@http://localhost:$TOMCAT_PORT@g" \
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
185 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/web.xml
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186
5268
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
187 sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log@g" \
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
188 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/WEB-INF/log4j.properties
4493
b15f82f0d652 Fixed path to client logging
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4491
diff changeset
189
5325
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
190 find $FLYS_SOURCE_DIR/flys/flys-artifacts/src/main/resources/ -name messages\*.properties | \
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
191 xargs sed -i "s@https://flys-intern.intevation.de/Flys-3.0@${WIKI_URL}@g";
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
192
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
193 find $FLYS_SOURCE_DIR/flys/ -name \*.properties -o -name \*.xsl | \
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
194 xargs sed -i "s@https://flys-intern.intevation.de@${WIKI_URL}@g";
5119
15ff9ddc765e Patch WIKI urls during release building
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4889
diff changeset
195
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
196 if [ ! -f $FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
197 echo "INFO: download OpenLayers-2.11 for client"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
198 cd $FLYS_SOURCE_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
199 curl -O http://openlayers.org/download/OpenLayers-2.11.tar.gz
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
200 tar xvfz OpenLayers-2.11.tar.gz
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
201 # TODO: Remove more superfluous OpenLayers stuff.
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
202 rm -rf OpenLayers-2.11/doc
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
203 rm -rf OpenLayers-2.11/tests
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
204 rm -rf OpenLayers-2.11/examples
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
205 cd $WORK_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
206 fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
207 cp -r $FLYS_SOURCE_DIR/OpenLayers-2.11 $FLYS_SOURCE_DIR/flys/flys-client/src/main/webapp/
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
208
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
209 echo "INFO: compile and build sources"
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
210 mvn -f $FLYS_SOURCE_DIR/artifacts/pom.xml clean compile package install
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
211 mvn -f $FLYS_SOURCE_DIR/flys/flys-backend/pom.xml clean compile package install
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
212 mvn -f $FLYS_SOURCE_DIR/flys/flys-artifacts/pom.xml clean compile package dependency:copy-dependencies install
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
213 mvn -f $FLYS_SOURCE_DIR/http-client/pom.xml clean compile package install
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
214 mvn -f $FLYS_SOURCE_DIR/flys/flys-client/pom.xml clean compile package
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
215
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
216
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
217 echo "INFO: copy dependencies and libs"
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
218 cp $FLYS_SOURCE_DIR/artifacts/artifact-database/target/artifact-database-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
219 cp $FLYS_SOURCE_DIR/artifacts/artifacts/target/artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
220 cp $FLYS_SOURCE_DIR/artifacts/artifacts-common/target/artifacts-common-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
221 cp $FLYS_SOURCE_DIR/flys/flys-backend/target/flys-backend-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
222 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/target/flys-artifacts-1.0-SNAPSHOT.jar $WORK_DIR/server/bin/lib/own/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
223 cp $FLYS_SOURCE_DIR/flys/flys-client/target/FLYS-1.0-SNAPSHOT.war $WORK_DIR/client/flys-${VERSION}.war
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
224 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/target/dependency/* $WORK_DIR/server/bin/lib/
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226 echo "INFO: copy scripts and libraries to target destination"
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
227 cp ${SCRIPT_DIR}/bin/run.sh $WORK_DIR/server/bin/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
228 cp ${SCRIPT_DIR}/bin/wsplgen.exe $WORK_DIR/server/bin/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
229 cp ${SCRIPT_DIR}/libs/* $WORK_DIR/server/bin/lib/
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
230
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
231
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
232 if [ "$BUILD_ORACLE" = "TRUE" ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
233 echo "INFO: remove PostgreSQL and PostGIS libraries"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
234 rm $WORK_DIR/server/bin/lib/postg*
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
235 rm $WORK_DIR/server/bin/lib/hibernate-spatial-postgis*
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
236 if [ ! -f $ORACLE_JDBC ]; then
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
237 echo "Could not find oracle jdbc in $ORACLE_JDBC"
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
238 echo "Please make sure that the ORACLE_JDBC variable is set correctly"
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
239 exit 1
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
240 fi
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
241 if [ ! -f $ORACLE_HIBERNATE ]; then
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
242 echo "Could not find hibernate-spatial-oracle in $ORACLE_HIBERNATE"
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
243 echo "Please make sure that the ORACLE_HIBERNATE variable is set correctly"
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
244 exit 1
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
245 fi
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
246 cp $ORACLE_HIBERNATE $ORACLE_JDBC $WORK_DIR/server/bin/lib/
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
247 else
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
248 echo "INFO: remove Oralce libraries"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
249 rm -f $WORK_DIR/server/bin/lib/hibernate-spatial-oracle-1.1.jar
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
250 rm -f $WORK_DIR/server/bin/lib/ojdbc*
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
251 fi
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
252
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
253 # fetch the configuration stuff
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
254 echo "INFO: copy default configuration to target destination"
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
255 cp -R $FLYS_SOURCE_DIR/flys/flys-artifacts/doc/conf $WORK_DIR/server/
4484
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
256
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
257 sed -i "s/8181/$ARTIFACT_PORT/g" \
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
258 $WORK_DIR/server/conf/rest-server.xml
4484
7e82d51c5a27 Improved build script
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4151
diff changeset
259
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
260 sed -i -e "s@http://example.com/@http://${MAPSERVER_URL}/@g" \
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
261 $WORK_DIR/server/conf/floodmap.xml
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
262
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
263 sed -i -e "s@http://example.com/@http://${MAPSERVER_URL}/@g" \
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
264 $WORK_DIR/server/conf/rivermap.xml
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
265
5325
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
266 sed -i -e "s@/tmp/flys-rivers-wms.log@${LOG_DIR}/rivers-wms-${VERSION}.log@g" \
5268
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
267 $WORK_DIR/server/conf/mapserver/river-mapfile.vm
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
268
5325
53aee7e9ce53 Be more aggressive when replacing the wiki url
Andre Heinecke <aheinecke@intevation.de>
parents: 5320
diff changeset
269 sed -i -e "s@/tmp/flys-user-wms.log@${LOG_DIR}/user-wms-${VERSION}.log@g" \
5268
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
270 $WORK_DIR/server/conf/mapserver/mapfile.vm
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
271
df7028d0cb93 Add LOG_DIR to make release to configure a logging directory. And
Andre Heinecke <aheinecke@intevation.de>
parents: 5255
diff changeset
272 sed "s@/tmp/flys-server-default.log@${LOG_DIR}/server-${VERSION}.log@" \
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
273 $SCRIPT_DIR/confs/log4j.properties \
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
274 > $WORK_DIR/server/conf/log4j.properties
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
275
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
276 cat > $WORK_DIR/server/conf/seddb-db.xml << EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
277 <?xml version="1.0" encoding="UTF-8" ?>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
278 <seddb-database>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
279 <!-- This is the default SedDB db configuration. -->
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
280 <user>$SEDDBUSER</user>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
281 <password>$SEDDBPASS</password>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
282 <dialect>org.hibernate.dialect.Oracle9iDialect</dialect>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
283 <driver>oracle.jdbc.driver.OracleDriver</driver>
5418
485ff339661e Add sedinitsqls to packaging script
Andre Heinecke <aheinecke@intevation.de>
parents: 5383
diff changeset
284 <url>jdbc:oracle:thin:@//$SEDDBURL:$SEDDBPORT/$SEDDBBACK</url>
485ff339661e Add sedinitsqls to packaging script
Andre Heinecke <aheinecke@intevation.de>
parents: 5383
diff changeset
285 <connection-init-sqls>$SEDINITSQLS</connection-init-sqls>
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
286 </seddb-database>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
287 EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
288
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
289 if [ "$BUILD_ORACLE" = "TRUE" ]; then
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
290 # Oracle backend configuration
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
291 cat > $WORK_DIR/server/conf/backend-db.xml << EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
292 <?xml version="1.0" encoding="UTF-8" ?>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
293 <backend-database>
5255
f890d315240f Fix oracle backend configuration and allow INITSQLS statement
Andre Heinecke <aheinecke@intevation.de>
parents: 5254
diff changeset
294 <user>$BACKENDUSER</user>
f890d315240f Fix oracle backend configuration and allow INITSQLS statement
Andre Heinecke <aheinecke@intevation.de>
parents: 5254
diff changeset
295 <password>$BACKENDPASS</password>
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
296 <dialect>org.hibernatespatial.oracle.OracleSpatial10gDialect</dialect>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
297 <driver>oracle.jdbc.driver.OracleDriver</driver>
5255
f890d315240f Fix oracle backend configuration and allow INITSQLS statement
Andre Heinecke <aheinecke@intevation.de>
parents: 5254
diff changeset
298 <url>jdbc:oracle:thin:@//$BACKENDURL:$BACKENDPORT/$BACKENDBACK</url>
f890d315240f Fix oracle backend configuration and allow INITSQLS statement
Andre Heinecke <aheinecke@intevation.de>
parents: 5254
diff changeset
299 <connection-init-sqls>$INITSQLS</connection-init-sqls>
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
300 </backend-database>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
301 EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
302 else
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
303 #Postgresql backend configuration
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
304 cat > $WORK_DIR/server/conf/backend-db.xml << EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
305 <?xml version="1.0" encoding="UTF-8" ?>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
306 <backend-database>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
307 <user>$BACKENDUSER</user>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
308 <password>$BACKENDPASS</password>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
309 <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
310 <driver>org.postgresql.Driver</driver>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
311 <url>jdbc:postgresql://$BACKENDURL:$BACKENDPORT/$BACKENDBACK</url>
5255
f890d315240f Fix oracle backend configuration and allow INITSQLS statement
Andre Heinecke <aheinecke@intevation.de>
parents: 5254
diff changeset
312 <connection-init-sqls>$INITSQLS</connection-init-sqls>
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
313 </backend-database>
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
314 EOF
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
315 fi
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
316
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
317 mkdir $WORK_DIR/artifactsdb
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
318 mkdir $WORK_DIR/datacagedb
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
319
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
320 cp $FLYS_SOURCE_DIR/artifacts/artifact-database/doc/schema-h2.sql $WORK_DIR/artifactsdb/artifacts-h2.sql
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
321 cp $FLYS_SOURCE_DIR/flys/flys-artifacts/doc/conf/datacage.sql $WORK_DIR/datacagedb/datacage.sql
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
322
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
323 echo "INFO: create h2 database for artifacts and datacage"
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
324 $SCRIPT_DIR/h2/createArtifacts.sh $WORK_DIR/artifactsdb/artifacts-h2.sql
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
325 $SCRIPT_DIR/h2/createDatacage.sh $WORK_DIR/datacagedb/datacage.sql
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
326
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
327 mv $WORK_DIR/artifactsdb $WORK_DIR/server/
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
328 mv $WORK_DIR/datacagedb $WORK_DIR/server/
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
329
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
330 echo "INFO: create tarball"
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
331 mkdir $WORK_DIR/flys-$VERSION
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
332 mv $WORK_DIR/server $WORK_DIR/client $WORK_DIR/flys-$VERSION
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
333 cd $WORK_DIR
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
334 tar cfz flys-$VERSION.tar.gz flys-$VERSION
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
335 echo "INFO: cleanup"
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
336 #rm -r $WORK_DIR/flys-$VERSION
4065
9d404069f361 Added build script for FLYS release.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
337
5251
8fa0c522bef3 Improve make_release script to optinally handle tagging and be more generic.
Andre Heinecke <aheinecke@intevation.de>
parents: 5220
diff changeset
338 echo "DONE: $WORK_DIR/flys-$VERSION.tar.gz"
5320
a7778435a4af Improve oracle integration and generate changelog when tagging
Andre Heinecke <aheinecke@intevation.de>
parents: 5268
diff changeset
339 echo "Changelog: $WORK_DIR/changes_$OLD_REV-$VERSION.txt"

http://dive4elements.wald.intevation.org