|
1 |
| -#! /bin/bash |
| 1 | +#! /bin/sh |
2 | 2 | #
|
3 | 3 | # This file is part of the Squashtest platform.
|
4 | 4 | # Copyright (C) 2010 - 2012 Henix, henix.fr
|
|
28 | 28 |
|
29 | 29 |
|
30 | 30 | # Default variables
|
31 |
| -JAR_NAME="org.apache.felix.main-4.2.1.jar" # Java main library |
| 31 | +JAR_NAME="squash-tm.war" # Java main library |
32 | 32 | HTTP_PORT=8080 # Port for HTTP connector (default 8080; disable with -1)
|
33 | 33 | # Directory variables
|
34 |
| -TMP_DIR=../tmp # Jetty tmp and work directory |
| 34 | +TMP_DIR=../tmp # Tmp and work directory |
35 | 35 | BUNDLES_DIR=../bundles # Bundles directory
|
36 |
| -CACHE_DIR=.. # Cache directory |
37 | 36 | CONF_DIR=../conf # Configurations directory
|
38 | 37 | LOG_DIR=../logs # Log directory
|
39 |
| -JETTY_HOME=../jettyhome # Jetty home directory |
| 38 | +TOMCAT_HOME=../tomcat-home # Tomcat home directory |
40 | 39 | LUCENE_DIR=../luceneindexes # Lucene indexes directory
|
41 | 40 | PLUGINS_DIR=../plugins # Plugins directory
|
42 | 41 | # DataBase parameters
|
43 |
| -DB_URL=${DB_URL:-"jdbc:h2:../data/squash-tm"} # DataBase URL |
44 |
| -DB_DRIVER=${DB_DRIVER:-"org.h2.Driver"} # DataBase driver |
45 |
| -DB_USERNAME=${DB_USERNAME:-"sa"} # DataBase username |
46 |
| -DB_PASSWORD=${DB_PASSWORD:-"sa"} # DataBase password |
47 |
| -DB_DIALECT=${DB_DIALECT:-"org.hibernate.dialect.H2Dialect"} # DataBase dialect |
| 42 | +DB_TYPE=h2 # DAtabase type, one of h2, mysql, postgresql |
| 43 | +DB_URL=jdbc:h2:../data/squash-tm # DataBase URL |
| 44 | +DB_USERNAME=sa # DataBase username |
| 45 | +DB_PASSWORD=sa # DataBase password |
48 | 46 | ## Do not configure a third digit here
|
49 |
| -REQUIRED_VERSION=1.6 |
| 47 | +REQUIRED_VERSION=1.7 |
50 | 48 | # Extra Java args
|
51 |
| -JAVA_ARGS=${JAVA_ARGS:-"-Xms128m -Xmx512m -XX:MaxPermSize=192m -server"} |
| 49 | +JAVA_ARGS="-Xms128m -Xmx512m -XX:MaxPermSize=192m -server" |
52 | 50 |
|
53 | 51 |
|
54 | 52 | # Tests if java exists
|
@@ -94,12 +92,11 @@ echo "done";
|
94 | 92 |
|
95 | 93 |
|
96 | 94 | # Let's go !
|
97 |
| -echo "$0 : starting Felix... "; |
| 95 | +echo "$0 : starting Squash TM... "; |
98 | 96 |
|
99 |
| -export _JAVA_OPTIONS="-Ddb.driver=${DB_DRIVER} -Ddb.url=${DB_URL} -Ddb.username=${DB_USERNAME} -Ddb.password=${DB_PASSWORD} -Ddb.dialect=${DB_DIALECT} -Duser.language=en" |
100 |
| -DAEMON_ARGS="${JAVA_ARGS} -Dbundles.dir=${BUNDLES_DIR} -Dcache.dir=${CACHE_DIR} -Dconf.dir=${CONF_DIR} -Dlog.dir=${LOG_DIR} -Dplugins.dir=${PLUGINS_DIR} -Djetty.logs=${LOG_DIR} -Dbundles.configuration.location=${CONF_DIR} -Dfelix.config.properties=file:${CONF_DIR}/felix.config.properties -Dfelix.system.properties=file:${CONF_DIR}/felix.system.properties -Djetty.port=${HTTP_PORT} -Djetty.home=${JETTY_HOME} -Dlucene.dir=${LUCENE_DIR} -Dgosh.args=--noi -Djava.io.tmpdir=${TMP_DIR} -Dlog4j.configuration=file:./conf/log4j.properties -jar ${JAR_NAME}" |
101 |
| - |
102 |
| -find ${TMP_DIR} -delete > /dev/null 2>&1 |
| 97 | +export _JAVA_OPTIONS="-Dspring.datasource.url=${DB_URL} -Dspring.datasource.username=${DB_USERNAME} -Dspring.datasource.password=${DB_PASSWORD} -Duser.language=en" |
| 98 | +DAEMON_ARGS="${JAVA_ARGS} -Djava.io.tmpdir=${TMP_DIR} -Dlogging.dir=${LOG_DIR} -jar ${BUNDLES_DIR}/${JAR_NAME} --spring.profiles.active=${DB_TYPE} --spring.config.location=${CONF_DIR}/squash.tm.cfg.properties --logging.config=${CONF_DIR}/log4j.properties --squash.path.bundles-path=${BUNDLES_DIR} --squash.path.plugins-path=${PLUGINS_DIR} --hibernate.search.default.indexBase=${LUCENE_DIR} --server.port=${HTTP_PORT} --server.tomcat.basedir=${TOMCAT_HOME} " |
103 | 99 |
|
104 | 100 | exec java ${DAEMON_ARGS}
|
105 | 101 |
|
| 102 | + |
0 commit comments