view contrib/make_flys_release/bin/make-importer-package.sh @ 8670:32682fa2127d

Move importer configuration to a single place.
author Tom Gottfried <tom@intevation.de>
date Thu, 09 Apr 2015 10:52:51 +0200
parents f7d3fc619976
children ae3df0f96e15
line wrap: on
line source
#!/bin/bash
set -e

# See README for more information

# The working directory. Resulting tarball will be placed in the directory above.
PKG_DIR=~/tmp/flys-importer
# Path to the flys checkout
FLYS_DIR=~/flys/river/
# Tarball that will be extracted into flys-importer/opt
EXTRAS=$1

rm -fr $PKG_DIR
mkdir -p $PKG_DIR/hydr_morph
mkdir -p $PKG_DIR/geodaesie
mkdir -p $PKG_DIR/opt/lib64
mkdir -p $PKG_DIR/schema

cd ${FLYS_DIR}/backend
mvn -f pom-oracle.xml clean compile assembly:single
cp target/backend-1.0-SNAPSHOT-jar-with-dependencies.jar \
    $PKG_DIR/hydr_morph/importer.jar
mvn -f pom.xml clean compile assembly:single
cp target/river-backend-1.0-SNAPSHOT-jar-with-dependencies.jar \
    $PKG_DIR/hydr_morph/importer_psql.jar
cp ${FLYS_DIR}/backend/contrib/shpimporter/*.py $PKG_DIR/geodaesie
cp ${FLYS_DIR}/backend/contrib/run_geo.sh \
    ${FLYS_DIR}/backend/contrib/run_hydr_morph.sh \
    ${FLYS_DIR}/backend/contrib/import_river.sh \
    $PKG_DIR
cp -r ${FLYS_DIR}/backend/doc/conf $PKG_DIR/
if [ -f "$EXTRAS" ]; then
    cd $PKG_DIR
    tar -xzf "$EXTRAS"
fi

cp ${FLYS_DIR}/backend/doc/schema/*.sql $PKG_DIR/schema

# create PDF of manual
REV=`hg parent | sed -n '1s/[[:alnum:]]*: *\([0-9]*:.*\)/\1/;1p'`
cd ${FLYS_DIR}/backend/doc/documentation/de/
sed -i "s/documentrevision..rev.*/documentrevision}{rev$REV}/" \
    importer-manual.tex
# run pdflatex three times to get references and page numbering right
pdflatex importer-manual.tex
pdflatex importer-manual.tex
pdflatex importer-manual.tex
cp importer-manual.pdf $PKG_DIR

sed -i 's/shpimporter\/shp/geodaesie\/shp/' $PKG_DIR/run_geo.sh

cd $PKG_DIR/..
DATE=$(date +%Y%m%d%H%M)
tar -czf flys-importer_${DATE}.tar.gz flys-importer
sha1sum flys-importer_${DATE}.tar.gz > flys-importer_${DATE}.tar.gz.sha1
echo Package is at: `readlink -f flys-importer_${DATE}.tar.gz`

http://dive4elements.wald.intevation.org