view contrib/make_flys_release/bin/make-importer-package.sh @ 9719:f3aa7a12c86a 3.2.x

It's no longer necessary to install these artifacts from a file Oracle-JDBC drivers are fetched from Maven repository since rev. ee1b409af91c.
author Tom Gottfried <tom@intevation.de>
date Mon, 12 Jul 2021 14:39:58 +0200
parents f7007b1aaa3f
children b1b48fa7bd80
line wrap: on
line source
#!/bin/bash
# Packaging-script for Dive4Elements River-Importer
#
# Copyright (C) 2011 - 2014 by Bundesanstalt für Gewässerkunde
# Software engineering by Intevation GmbH
#
# This file is Free Software under the GNU AGPL (>=v3)
# and comes with ABSOLUTELY NO WARRANTY! Check out the
# documentation coming with Dive4Elements River for details.

set -e

# See ../README for more information
# The working directory. Resulting tarball will be placed here.
PKG_DIR=/tmp/flys-importer
# Path to the flys checkout
SOURCE_DIR=$(readlink -f `dirname $0`)/../../..

usage(){
    cat << EOF

usage: $0 [options] VERSION [EXTRAS]

Create a D4E River Importer-package

OPTIONS:
   -?, --help          Show this message
   -o, --oracle        Package is for Oracle.
   VERSION must specify a tag (usually MAYOR.MINOR.PATCH) or a branch name.
   With EXTRAS, a tarball with dependencies can be given.
EOF
exit 0
}

OPTS=`getopt -o ?,o -l help,oracle -n $0 -- "$@"`

if [ $? != 0 ] ; then usage; fi
eval set -- "$OPTS"
while true ; do
  case "$1" in
    "-?"|"--help")
      usage;;
    "--")
      shift
      break;;
    "-o"|"--oracle")
      BUILD_ORACLE="TRUE"
      shift;;
    *)
      echo "Unknown Option $1"
      usage;;
  esac
done

if [ $# != 1 ]; then
    usage
fi

VERSION=$1
EXTRAS=$2

# Update to VERSION
echo "WARNING: any local changes in $SOURCE_DIR will be packaged."
cd ${SOURCE_DIR}
if [ -z "`hg tags | sed -n "/$VERSION/p"`" -a -z "`hg branches | sed -n "/$VERSION/p"`" ]
then
    echo "ERROR: No tag or branch $VERSION found in repository of $repo!"
    exit 1
else
    hg up "$VERSION"
fi

# create PDF of manual
REV=`hg parent | sed -n '1s/[[:alnum:]]*: *\([0-9]*:.*\)/\1/;1p'`
cd ${SOURCE_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

# package importer
if [ "$BUILD_ORACLE" = "TRUE" ]; then
    mvn -f $SOURCE_DIR/backend/pom-oracle.xml clean package assembly:single
else
    mvn -f $SOURCE_DIR/backend/pom.xml clean package assembly:single
fi

echo "INFO: create tarball"
rm -fr $PKG_DIR
mkdir $PKG_DIR
cd $PKG_DIR

mv $SOURCE_DIR/backend/target/river-backend-1.0-SNAPSHOT*-flys-importer.tar \
    flys-importer-$VERSION.tar
if [ -f "$EXTRAS" ]; then
    tar -xzf "$EXTRAS"
    tar -rf flys-importer-$VERSION.tar opt
fi

gzip flys-importer-$VERSION.tar
sha1sum flys-importer-$VERSION.tar.gz > flys-importer-$VERSION.tar.gz.sha1
echo Package is at: `readlink -f flys-importer-$VERSION.tar.gz`

http://dive4elements.wald.intevation.org