diff --git a/bin/clean.sh b/bin/clean.sh new file mode 100755 index 00000000000..e64caa0308a --- /dev/null +++ b/bin/clean.sh @@ -0,0 +1,28 @@ +#!/bin/sh +set -x +. config.sh +dropdb $DB + +case $POSTGIS_INSTALL in + "POSTGIS 2 create") + createdb -O www-data $DB + psql -d $DB -c "CREATE EXTENSION postgis;" + psql -d $DB -c "CREATE EXTENSION postgis_topology;" + psql -d $DB -f $SQL_DIR/legacy.sql + ;; + "template") + createdb -O www-data $DB -T template_postgis + ;; + "POSTGIS 1 create") + createdb -O www-data $DB + createlang plpgsql $DB + psql -d $DB -f $SQL_DIR/postgis.sql + psql -d $DB -f $SQL_DIR/spatial_ref_sys.sql + ;; +esac + +rm -rf $DATA_DIR +mkdir -p $DATA_DIR/config/ +cp -R $WEB_DIR/src/main/webapp/WEB-INF/data/config/codelist $DATA_DIR/config/ +cp -R $WEB_DIR/src/main/webapp/WEB-INF/data/config/schema_plugins $DATA_DIR/config/ + diff --git a/bin/config.sh b/bin/config.sh new file mode 100644 index 00000000000..93a86df30fb --- /dev/null +++ b/bin/config.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# resolve links - so that script can be called from any dir +PRG="$0" + +while [ -h "$PRG" ]; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`/"$link" + fi +done + +# Get standard environment variables +PRGDIR=`dirname "$PRG"` + +WEB_DIR="$PRGDIR/../web" +JEEVES_DIR="$PRGDIR/../web" + + +################################################# +# The parameters below can be overridden in your personal +# configuration file if the default don't work +################################################# +DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" +OVERRIDES="-Dgeonetwork.jeeves.configuration.overrides.file=/WEB-INF/override-config-jeichar.xml" +MEMORY="-XX:MaxPermSize=256m -Xmx1024M -server" +DATA_DIR="$HOME/gc_data" +LOGGING="-Dfile.encoding=UTF8 -Dlog4j.debug=true -Dlog4j.configuration=file://$WEB_DIR/src/main/webapp/WEB-INF/log4j-jeichar.cfg" +DB="geocat2_trunk" +SQL_DIR="/usr/local/share/postgis/" +POSTGIS_INSTALL="template" # options are: "template" or "POSTGIS 2 create" or "POSTGIS 1 create" +export PG_PASSWORD="www-data" + +# Load personal config file +CONFIG_FILE="config_`whoami`.sh" +. $CONFIG_FILE diff --git a/bin/config_fgravin.sh b/bin/config_fgravin.sh new file mode 100644 index 00000000000..c1c05945276 --- /dev/null +++ b/bin/config_fgravin.sh @@ -0,0 +1,3 @@ +DB=geocat2_trunk +SQL_DIR=/usr/lib/postgis/ +POSTGIS_INSTALL="template" \ No newline at end of file diff --git a/bin/config_fvanderbiest.sh b/bin/config_fvanderbiest.sh new file mode 100644 index 00000000000..fcc18f650e2 --- /dev/null +++ b/bin/config_fvanderbiest.sh @@ -0,0 +1,3 @@ +DB=geocat +SQL_DIR=/usr/local/share/postgis +POSTGIS_INSTALL="template" \ No newline at end of file diff --git a/bin/config_jeichar.sh b/bin/config_jeichar.sh new file mode 100644 index 00000000000..b3441c22327 --- /dev/null +++ b/bin/config_jeichar.sh @@ -0,0 +1,3 @@ +DB=geocat2_trunk +SQL_DIR=/usr/local/share/postgis/ +POSTGIS_INSTALL="POSTGIS 2 create" \ No newline at end of file diff --git a/bin/start.sh b/bin/start.sh new file mode 100755 index 00000000000..23292a88850 --- /dev/null +++ b/bin/start.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -x + +. config.sh + +if [ -z "$JREBEL_HOME" ] ; then + echo "you do not have JREBEL installed. If you want to use JREBEL install it and define JREBEL_HOME. It can be defined in the config.sh file in your profile" +else + JREBEL_OPTS="-noverify -javaagent:$JREBEL_HOME/jrebel.jar" +fi + +export MAVEN_OPTS="$JREBEL_OPTS $DEBUG $OVERRIDES $MEMORY -Dgeonetwork.dir=$DATA_DIR " + +cd $JEEVES_DIR +mvn install $@ +if [ ! $? -eq 0 ]; then + echo "[FAILURE] [deploy] Failed to execute 'jeeves' correctly" + exit -1 +fi + +cd $WEB_DIR +mvn jetty:run -Penv-dev $@ \ No newline at end of file