Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make run and setup scripts easier for all to use
- Loading branch information
Jesse Eichar
committed
Nov 23, 2012
1 parent
eccfda8
commit 98fa558
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DB=geocat2_trunk | ||
SQL_DIR=/usr/lib/postgis/ | ||
POSTGIS_INSTALL="template" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DB=geocat | ||
SQL_DIR=/usr/local/share/postgis | ||
POSTGIS_INSTALL="template" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DB=geocat2_trunk | ||
SQL_DIR=/usr/local/share/postgis/ | ||
POSTGIS_INSTALL="POSTGIS 2 create" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 $@ |