[PATCH] Release script: remove installation specific defaults and give the possibility to overwrite any config-file in WEB-INF
Wald Commits
scm-commit at wald.intevation.org
Mon Dec 15 19:30:39 CET 2014
# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1418668210 -3600
# Node ID c8d633c0971b483e9a578a167b0ed44b0d07d980
# Parent 414e68e6d19a70077554160f44cdad5e50b7f436
Release script: remove installation specific defaults and give the possibility to overwrite any config-file in WEB-INF.
diff -r 414e68e6d19a -r c8d633c0971b contrib/make_flys_release/README
--- a/contrib/make_flys_release/README Mon Dec 15 19:27:04 2014 +0100
+++ b/contrib/make_flys_release/README Mon Dec 15 19:30:10 2014 +0100
@@ -5,10 +5,6 @@
Wichtige variablen sind:
FLYS_SOURCE_DIR
-TOMCAT_PORT
-FONT_PATH
-WIKI_URL
-LOG_DIR
DEVELOPER
DEFAULT_WD
@@ -20,14 +16,17 @@
Skriptes angegebene Version ersetzt.
Mit folgenden Umgebungsvariablen können auch einzelne Teile der Artefakt-
-Server-Konfiguration angepasst werden (die geschieht bevor die Default-
+Server-Konfiguration angepasst werden (dies geschieht bevor die Default-
Konfigurations-Dateien überschrieben werden!):
-ARTIFACT_PORT: Port für den Artefakt-Server.
-DGM_PATH: Prefix für die in der Backend-Datenbank gespeicherten Pfade zu
- den digitalen Gelände-Modellen.
-WIKI_URL: URL für die Online-Hilfe (auch für Client-Konfiguration)
+DGM_PATH: Prefix für die in der Backend-Datenbank gespeicherten Pfade zu
+ den digitalen Gelände-Modellen.
+WIKI_URL: URL für die Online-Hilfe (auch für Client-Konfiguration)
-FEATURES_XML (Wenn gesetzt pfad zu einer zu verwendenden features.xml)
+WEBINF: Pfad zu einem Verzeichnis, dessen Inhalt in das
+ 'WEB-INF'-Verzeichnis des GWT-Clients kopiert wird um
+ Default-Konfigurations-Dateien zu überschreiben. Die Zeichenkette
+ 'D4E_VERSION' wird in den so gegebenen Konfigurationsdateien durch
+ die beim Aufruf des Skriptes angegebene Version ersetzt.
Prozess:
========
diff -r 414e68e6d19a -r c8d633c0971b contrib/make_flys_release/make_release.sh
--- a/contrib/make_flys_release/make_release.sh Mon Dec 15 19:27:04 2014 +0100
+++ b/contrib/make_flys_release/make_release.sh Mon Dec 15 19:30:10 2014 +0100
@@ -30,7 +30,7 @@
usage: $0 [options] VERSION
-Create a flys package
+Create a D4E River package
OPTIONS:
-?, --help Show this message
@@ -55,16 +55,8 @@
# --seddb-user Sediment db user. Default: $SEDDBUSER
# --seddb-pass Sediment db password. Default: $SEDDBPASS
# --seddb-back Sediment db backend. Default: $SEDDBBACK
-TOMCAT_PORT=${TOMCAT_PORT:-8282}
-WIKI_URL=${WIKI_URL:-https://flys3-devel.bafg.de/wiki}
-# Prefix to FreeSans.ttf
-FONT_PATH=${FONT_PATH:-/opt/flys}
-# Backend configuration
-LOG_DIR=/var/log/flys
-
-# Client configuration
-AUTH=${AUTH:-GGinA}
+# customizable variables
ELBE_MODEL_UUID=${ELBE_MODEL_UUID:-1a4825f6-925f-11e3-8165-001f29e71d12}
OPTS=`getopt -o ?w:,t,o \
@@ -100,11 +92,6 @@
fi
VERSION=$1
-if [ -n "`hg branches | sed -n "/$VERSION/p"`" ]; then
- ARTIFACT_PORT=${ARTIFACT_PORT:-29999}
-else
- ARTIFACT_PORT=${ARTIFACT_PORT:-`echo 1$VERSION | sed 's/\.//g'`}
-fi
if [ -z $WORK_DIR ]; then
WORK_DIR=$DEFAULT_WD
@@ -154,7 +141,7 @@
cd $repo
if [ -z "`hg tags | sed -n "/$VERSION/p"`" -a -z "`hg branches | sed -n "/$VERSION/p"`" ]
then
- echo "[WARNING]: $VERSION not found in $repo! Updating to default."
+ echo "WARNING: $VERSION not found in $repo! Updating to default."
hg up default
else
hg up "$VERSION"
@@ -168,59 +155,22 @@
mkdir "$WORK_DIR/server/shapefiles"
mkdir "$WORK_DIR/client"
-echo "[INFO]: Preparing configuration of web client"
-echo "[INFO]: Tomcat Port: $TOMCAT_PORT"
-echo "[INFO]: Artifact Port: $ARTIFACT_PORT"
+
+echo "INFO: Preparing configuration of web client"
#Needs to be done before the tomcat replacement below
-if [ -r "$FEATURES_XML" ]; then
- cp "$FEATURES_XML" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/features.xml
-fi
-
-if [ -r "$CLIENT_LOG4J" ]; then
- cp "$CLIENT_LOG4J" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties
-fi
-
-sed -i -e "s at http://localhost:8080/d4e-river/flys/mapfish-print at https://localhost/flys-${VERSION}/flys/mapfish-print at g" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/web.xml
-
-sed -i -e "s at http://localhost:8181 at http://localhost:$ARTIFACT_PORT at g" \
- -e "s at http://localhost:8888 at http://localhost:$TOMCAT_PORT at g" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/web.xml
-
-sed -i -e "s@<param-value>plain</param-value>@<param-value>$AUTH</param-value>@" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/web.xml
-
-sed -i -e "s at https://flys3-devel.bafg.de/wiki@${WIKI_URL}@g" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/java/org/dive4elements/river/client/client/config.xml
-
-sed -i -e \
- "s@/var/log/d4e-river/d4e-client.log@${LOG_DIR}/client-VERSION.log at g" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties
-
-sed -i -e "s at VERSION@${VERSION}@g" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties
-
sed -i -e "s at 1a4825f6-925f-11e3-8165-001f29e71d12@${ELBE_MODEL_UUID}@g" \
$FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html
-find $FLYS_SOURCE_DIR/river/ -name \*.properties -o -name \*.xsl | \
- xargs sed -i "s at https://flys-intern.intevation.de@${WIKI_URL}@g";
-
-if [ -r "$WMSSERVICES_XML" ]; then
- cp "$WMSSERVICES_XML" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/wms-services.xml
+if [ -d $WEBINF ]; then
+ echo "INFO: copy custom client configuration to target destination"
+ WEBINF_DIR=$FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/
+ cp -R $WEBINF/* $WEBINF_DIR
+ for file in `find $WEBINF_DIR/ -type f`; do
+ sed -i -e "s at D4E_VERSION@${VERSION}@g" $file
+ done
fi
-if [ -r "$CONFIG_YAML" ]; then
- cp "$CONFIG_YAML" $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/config.yaml
-fi
-
-sed -i -e "s@/usr/share/fonts/truetype/freefont@${FONT_PATH}@g" \
- $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/config.yaml
-
if [ ! -f $FLYS_SOURCE_DIR/OpenLayers-2.11.tar.gz ]; then
echo "INFO: download OpenLayers-2.11 for client"
@@ -287,18 +237,15 @@
fi
cp $ORACLE_HIBERNATE $ORACLE_JDBC $WORK_DIR/server/bin/lib/
else
- echo "INFO: remove Oralce libraries"
+ echo "INFO: remove Oracle libraries"
rm -f $WORK_DIR/server/bin/lib/hibernate-spatial-oracle-1.1.jar
rm -f $WORK_DIR/server/bin/lib/ojdbc*
fi
-echo "INFO: copy default configuration to target destination"
+echo "INFO: copy default server configuration to target destination"
cp -R $FLYS_SOURCE_DIR/river/artifacts/doc/conf $WORK_DIR/server/
-sed -i "s/8181/$ARTIFACT_PORT/g" \
- $WORK_DIR/server/conf/rest-server.xml
-
if [ -n $DGM_PATH ]; then
sed -i -e "s@<dgm-path>/path/to/rivers/</dgm-path>@<dgm-path>${DGM_PATH}</dgm-path>@g" \
$WORK_DIR/server/conf/conf.xml
@@ -310,7 +257,7 @@
fi
if [ -d $SERVER_CONF ]; then
- echo "INFO: copy custom configuration to target destination"
+ echo "INFO: copy custom server configuration to target destination"
cp -R $SERVER_CONF/* $WORK_DIR/server/conf/
for file in `find $WORK_DIR/server/conf -type f`; do
sed -i -e "s at D4E_VERSION@${VERSION}@g" $file
More information about the Dive4Elements-commits
mailing list