diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b1b714bcbe2a344f84d76ec6597a109a309a4a9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/TASMAN-webapp/nb-configuration.xml +/TASMAN-webapp/nbactions.xml +/TASMAN-webapp/faces-config.NavData +/TASMAN-core/target/ +/TASMAN-webapp/target/ +/TASMAN-core/nb-configuration.xml +/TASMAN-embedded/target/ +/TASMAN-core/nbproject/ +/TASMAN-bom/target/ +config.properties +test.properties +/**/pom.xml.versionsBackup +install.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..ba91c9321752469fee140dd937e2ca1f87cd1c52 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,2 @@ +build: + script: "cd TASMAN-core; mvn clean install -P Test -Dmysql_host=localhost -Dmysql_port=3306 -Dmysql_user=tasman_tester -D mysql_password=tasman_tester -Dpostgres_host=localhost -Dpostgres_port=5432 -Dpostgres_user=tasman_tester -Dpostgres_password=tasman_tester -Dpostgres_database=tasman_test" diff --git a/README.md b/README.md index 3ca24c54f4886725548fa8123394a36debf45b01..9648d38d03387423a6531ab1db11f334c3e59f64 100644 --- a/README.md +++ b/README.md @@ -5,41 +5,24 @@ See also the [CHANGELOG](CHANGELOG.md). ## Build -### Build the API - - cd TASMAN-core - mvn install - -#### WARNING: test -Test suite for the TASMAN-core assumes some hardcoded values. If they -fail simply put an _@Ignore_ in front on the test class. - -### Build the Web application - - cd TASMAN-webapp - -Edit configuration properties file (`src/main/resources/webapp.properties`): - - ucd_service_url=<URL for the UCD REST web service> - config_file_path=<location where the web app will store the generated XML configuration> - -IA2 UCD service is at http://ia2-vo.oats.inaf.it:8080/ucd/ - -If the UCD web service is unreachable the web app will work anyway, but without the UCD search functionality. - -Then build the web application: - -* GlassFish war package (default): - - mvn install - -* Tomcat war package: - - mvn -P Tomcat install +1. Create a `config.properties` file (copy it from `config.properties.example`). In this file it is specified: + * **ucd_service_url**: the URL for the UCD REST web service. + * IA2 UCD service is at http://ia2-vo.oats.inaf.it/ucd/ + * if the UCD web service is unreachable the web app will work anyway, but without the UCD search functionality. + * **config_file_path**: the location where the web app will store the generated XML configuration (the location needs to be writable by the application server in which TASMAN will run). + +2. `chmod +x build.sh` +3. `./build.sh <command>`, commands are: + * **core** build only TASMAN core + * **test**: run tests; you need to create a `test.properties` file containing a configuration for connecting to a MySQL and a Postgres test database + * **glassfish**: build GlassFish war package + * **tomcat**: build Tomcat war package (using config.properties file) + * **embedded**: build embedded package (to be run _locally!_) + * **installer**: build install script (produce self-extracting install.sh script) ## Supported application servers -The web app was tested with: +The web app has been tested with: * GlassFish 4.1 * Tomcat 8.0.33 @@ -51,9 +34,8 @@ Build requires _Ucidy_ and _Unity_ that are not available at central maven repo. You should have them installed in a local maven repo. To do this: download the jar files listed in the following -credits section and runn a couple of `mvn install:install-file` -commands based upond the dependencies description in the _TASMAN-webapp_ -_pom.xml_ file. +credits section and run a couple of `mvn install:install-file` +commands based upond the dependencies description in the _TASMAN-webapp_ _pom.xml_ file. ## Credits diff --git a/TASMAN-bom/pom.xml b/TASMAN-bom/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..7e851673059a98dab666c83d1e86a9d6ca141fcb --- /dev/null +++ b/TASMAN-bom/pom.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>it.inaf.ia2.tsm</groupId> + <artifactId>tasman-bom</artifactId> + <version>1.3.2</version> + + <packaging>pom</packaging> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.7</maven.compiler.source> + <maven.compiler.target>1.7</maven.compiler.target> + <netbeans.hint.license>inaf-license-netbeans</netbeans.hint.license> + <maven.test.skip>true</maven.test.skip> + </properties> + + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.7.21</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.10</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.10.4</version> + <configuration> + <show>public</show> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.20</version> + <configuration> + <trimStackTrace>false</trimStackTrace> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/TASMAN-core/pom.xml b/TASMAN-core/pom.xml index bc78d632e1940ba2d01c52e268e77c6069f7886d..23781ded8adc345d264086cad73a9fb19c50c3b1 100644 --- a/TASMAN-core/pom.xml +++ b/TASMAN-core/pom.xml @@ -1,17 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>it.inaf.ia2.tap</groupId> + + <parent> + <groupId>it.inaf.ia2.tsm</groupId> + <artifactId>tasman-bom</artifactId> + <version>1.3.2</version> + </parent> + <artifactId>tasman-core</artifactId> - <version>1.3.2</version> <packaging>jar</packaging> - <name>tasman-core</name> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.7</maven.compiler.source> - <maven.compiler.target>1.7</maven.compiler.target> - <netbeans.hint.license>inaf-license-netbeans</netbeans.hint.license> - </properties> + <dependencies> <dependency> <groupId>org.apache.tomcat</groupId> @@ -31,36 +30,22 @@ <version>9.3-1104-jdbc41</version> <scope>runtime</scope> </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.7.21</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.10</version> - <scope>test</scope> - </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration> - <show>public</show> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.20</version> - <configuration> - <trimStackTrace>false</trimStackTrace> - </configuration> - </plugin> - </plugins> - </build> + + <profiles> + <profile> + <id>test</id> + <properties> + <maven.test.skip>false</maven.test.skip> + </properties> + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + </build> + </profile> + </profiles> </project> \ No newline at end of file diff --git a/TASMAN-core/src/test/java/it/inaf/ia2/tsm/TestAll.java b/TASMAN-core/src/test/java/it/inaf/ia2/tsm/TestAll.java index d68c4e6a15b246fc67b7994f515de8f8b5241236..cddb76039d653070b4682d7347ce5620af857dd6 100644 --- a/TASMAN-core/src/test/java/it/inaf/ia2/tsm/TestAll.java +++ b/TASMAN-core/src/test/java/it/inaf/ia2/tsm/TestAll.java @@ -28,6 +28,8 @@ import it.inaf.ia2.tsm.datalayer.Credentials; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.sql.Connection; @@ -37,6 +39,7 @@ import java.sql.Statement; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.Properties; import java.util.Set; import org.junit.After; import org.junit.AfterClass; @@ -44,7 +47,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; -import org.junit.Ignore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,21 +68,29 @@ public class TestAll { } @BeforeClass - public static void setUpClass() throws SQLException { + public static void setUpClass() throws SQLException, IOException { + + Properties props = new Properties(); + try (InputStream in = TestAll.class.getClassLoader().getResourceAsStream("test.properties")) { + props.load(in); + } dbWrappers = new ArrayList<>(); // MYSQL Credentials mysqlCredentials = new Credentials(DatabaseType.MYSQL); - mysqlCredentials.setHostname("localhost"); - mysqlCredentials.setUsername("root"); - mysqlCredentials.setPassword("root"); + mysqlCredentials.setHostname(props.getProperty("mysql_host")); + mysqlCredentials.setPort(Integer.parseInt(props.getProperty("mysql_port"))); + mysqlCredentials.setUsername(props.getProperty("mysql_user")); + mysqlCredentials.setPassword(props.getProperty("mysql_password")); // POSTGRES Credentials postgresCredentials = new Credentials(DatabaseType.POSTGRES); - postgresCredentials.setHostname("localhost"); - postgresCredentials.setUsername("postgres"); - postgresCredentials.setPassword("pippo"); + postgresCredentials.setHostname(props.getProperty("postgres_host")); + postgresCredentials.setPort(Integer.parseInt(props.getProperty("postgres_port"))); + postgresCredentials.setUsername(props.getProperty("postgres_user")); + postgresCredentials.setPassword(props.getProperty("postgres_password")); + postgresCredentials.setDatabase(props.getProperty("postgres_database")); DBWrapper dbWrapper = new DBWrapper(mysqlCredentials); dbWrapper.testConnections(); diff --git a/TASMAN-embedded/pom.xml b/TASMAN-embedded/pom.xml index ce0eb8b0eac058c64c45b741dd6f6b4a9a99bc56..dc688c753aca7e5c8bade4bb91502712cd9823de 100644 --- a/TASMAN-embedded/pom.xml +++ b/TASMAN-embedded/pom.xml @@ -2,15 +2,16 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>it.inaf.ia2.tap</groupId> + <parent> + <groupId>it.inaf.ia2.tsm</groupId> + <artifactId>tasman-bom</artifactId> + <version>1.3.2</version> + </parent> + <artifactId>tasman-embedded</artifactId> - <version>1.2.0</version> <packaging>jar</packaging> <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.7</maven.compiler.source> - <maven.compiler.target>1.7</maven.compiler.target> <jetty.version>9.4.6.v20170531</jetty.version> </properties> @@ -36,6 +37,12 @@ </dependencies> <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/TASMAN-embedded/src/main/resources/app.properties b/TASMAN-embedded/src/main/resources/app.properties index 086a164d6b7b30c04cfbed40326db687137e123a..aa8df7e0854893c250b352a74ab16400a6a3e71f 100644 --- a/TASMAN-embedded/src/main/resources/app.properties +++ b/TASMAN-embedded/src/main/resources/app.properties @@ -1,2 +1,2 @@ -warFilePath=/home/sonia/git/TASMAN/TASMAN-webapp/target/tasman-webapp-1.3.2.war +warFilePath=${war_file_path} defaultPort=8080 \ No newline at end of file diff --git a/TASMAN-webapp/pom.xml b/TASMAN-webapp/pom.xml index 1fdfc17d69198687a00110a3929aee70a49c669f..06cbf40a0d8282a3318a5a34897fbdd22f8f09e4 100644 --- a/TASMAN-webapp/pom.xml +++ b/TASMAN-webapp/pom.xml @@ -2,17 +2,17 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>it.inaf.ia2.tap</groupId> + <parent> + <groupId>it.inaf.ia2.tsm</groupId> + <artifactId>tasman-bom</artifactId> + <version>1.3.2</version> + </parent> + <artifactId>tasman-webapp</artifactId> - <version>1.3.2</version> <packaging>war</packaging> - <name>tasman-webapp</name> - <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <netbeans.hint.license>inaf-license-netbeans</netbeans.hint.license> <jersey.version>2.23.2</jersey.version> <deltaspike.version>1.7.2</deltaspike.version> <enable.weld.config.start></enable.weld.config.start> @@ -128,9 +128,9 @@ <dependencies> <dependency> - <groupId>it.inaf.ia2.tap</groupId> + <groupId>${project.groupId}</groupId> <artifactId>tasman-core</artifactId> - <version>1.3.2</version> + <version>${project.version}</version> </dependency> <dependency> <groupId>ari.ucidy</groupId> @@ -155,17 +155,6 @@ <type>jar</type> <scope>runtime</scope> </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.7.21</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.10</version> - <scope>test</scope> - </dependency> <dependency> <groupId>org.apache.deltaspike.modules</groupId> <artifactId>deltaspike-jsf-module-impl</artifactId> @@ -228,6 +217,7 @@ <filtering>true</filtering> <includes> <include>**/version.txt</include> + <include>**/webapp.properties</include> </includes> </resource> <!-- Include all other files without filtering them --> @@ -236,6 +226,7 @@ <filtering>false</filtering> <excludes> <exclude>**/version.txt</exclude> + <exclude>**/webapp.properties</exclude> </excludes> </resource> </resources> @@ -245,8 +236,8 @@ <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> - <source>1.7</source> - <target>1.7</target> + <source>${maven.compiler.source}</source> + <target>${maven.compiler.target}</target> <compilerArguments> <endorseddirs>${endorsed.dir}</endorseddirs> </compilerArguments> diff --git a/TASMAN-webapp/src/main/resources/webapp.properties b/TASMAN-webapp/src/main/resources/webapp.properties index bb985de46f71749c76181acca689ddcb24779571..50de92b9d4b59e3058ff087d70419880200dd3ce 100644 --- a/TASMAN-webapp/src/main/resources/webapp.properties +++ b/TASMAN-webapp/src/main/resources/webapp.properties @@ -1,2 +1,4 @@ -ucd_service_url=http://ia2-vo.oats.inaf.it/ucd/ -config_directory=/home/sonia/.tasman \ No newline at end of file +# URL for the UCD REST web service +ucd_service_url=${ucd_service_url} +# location where the web app will store the generated XML configuration +config_directory=${config_directory} \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..2333fab4cb0e31e8706460674c2b35feda617d2f --- /dev/null +++ b/build.sh @@ -0,0 +1,182 @@ +#!/bin/bash + +config_file="config.properties" +test_config_file="test.properties" + +if [ ! -f "$config_file" ]; then + echo "$config_file doesn't exist!" + exit 1 +fi + +# Append to a command a list of environment variables defined into a file +function add_properties { + command=$1 + properties_file=$2 + + while read line + do + if [[ ! -z "$line" ]] && [[ ! "$line" =~ ^\# ]]; then + command="$command -D$line" + fi + done <<< "$(cat ../$properties_file)" + + echo $command +} + +function build_core { + cd TASMAN-core + mvn -q clean install + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-core built" + cd .. +} + +function test_core { + cd TASMAN-core + $(add_properties "mvn clean install -P test" $test_config_file) + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + cd .. +} + +function build_web_glassfish { + build_core + + # build webapp + cd TASMAN-webapp + $(add_properties "mvn -q clean install" $config_file) + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-webapp built" + cd .. +} + +function build_web_tomcat { + build_core + + # build webapp + cd TASMAN-webapp + $(add_properties "mvn -q clean install -P ServletContainer" $config_file) + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-webapp built" + cd .. +} + +function build_web_embedded { + build_core + + # build webapp + cd TASMAN-webapp + $(add_properties "mvn -q clean install -P ServletContainer,Jetty" $config_file) + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-webapp built" + cd .. + + # build embedded + cd TASMAN-embedded + war_file_path=`dirname ${PWD}`/TASMAN-webapp/target/tasman-webapp-*.war + war_file_path=`ls $war_file_path` + mvn clean -q install -Dwar_file_path=$war_file_path + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-embedded built" + cd .. +} + +function build_installer_package { + build_core + + # build webapp + cd TASMAN-webapp + mvn -q clean install -P ServletContainer,Jetty + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-webapp built" + cd .. + + # build embedded + cd TASMAN-embedded + mvn -q clean install + if [ "$?" -ne 0 ]; then + echo "[ERROR] Error in ${FUNCNAME[0]}" + exit 1 + fi + echo "TASMAN-embedded built" + cd .. + + # copy TASMAN files + cp TASMAN-webapp/target/tasman-webapp-*.war . + cp TASMAN-embedded/target/tasman-embedded.jar . + mv tasman-webapp-*.war tasman-webapp.war + # create tar for self-extracting installer + tar cfz tasman.tar.gz tasman-webapp.war tasman-embedded.jar + rm tasman-webapp.war + rm tasman-embedded.jar + cp install_template.sh install.sh + cat tasman.tar.gz >> install.sh + rm tasman.tar.gz + echo "TASMAN install.sh built" +} + +function print_usage { + echo "USAGE:" + echo " $0 command" + echo " " + echo "COMMANDS:" + echo " core build only TASMAN core" + echo " test run tests (using test.properties file)" + echo " glassfish build GlassFish war package (using config.properties file)" + echo " tomcat build Tomcat war package (using config.properties file)" + echo " embedded build embedded package (using config.properties file)" + echo " installer build install script (produces install.sh as output)" + exit 0 +} + +if [ "$#" -ne 1 ]; then + print_usage +fi + +case "$1" in +"core") + build_core + ;; +"test") + if [ ! -f "$test_config_file" ]; then + echo "$test_config_file doesn't exist!" + exit 1 + fi + test_core + ;; +"glassfish") + build_web_glassfish + ;; +"tomcat") + build_web_tomcat + ;; +"embedded") + build_web_embedded + ;; +"installer") + build_installer_package + ;; +*) + print_usage + ;; +esac diff --git a/config.properties.example b/config.properties.example new file mode 100644 index 0000000000000000000000000000000000000000..1d37d00f1a1ad183f363a7add1f5f58e7c7452cd --- /dev/null +++ b/config.properties.example @@ -0,0 +1,2 @@ +ucd_service_url=http://ia2-vo.oats.inaf.it/ucd/ +config_directory=/home/user/.tasman \ No newline at end of file diff --git a/install.sh b/install_template.sh old mode 100755 new mode 100644 similarity index 88% rename from install.sh rename to install_template.sh index 4135e2d512e514b1c75fcad0a596d115b260a070..56dbf95e807672a1214ad416c31d69b22c890df2 --- a/install.sh +++ b/install_template.sh @@ -12,6 +12,9 @@ echo "# #" echo "############################################" echo "" +# Credits for the self-extracting part: +# http://www.linuxjournal.com/node/1005818 + echo "Welcome on the TASMAN installer" # Run as root check @@ -20,6 +23,33 @@ if [[ "$(id -u)" != "0" ]]; then exit 1 fi +# Tasman installation dir +echo -e "Specify TASMAN installation directory [/opt/tasman]: \c" +read install_dir +if [[ -z "$install_dir" ]]; then + install_dir="/opt/tasman" +fi + +# Creating installation directory +mkdir -p "$install_dir" +if [ ! $? -eq 0 ]; then + echo "Unable to create installation directory $install_dir" + exit 1 +fi + +# Add final slash to installation dir if it is necessary +if [[ "$install_dir" != *\/ ]]; then + install_dir="$install_dir/" +fi + +# Find __ARCHIVE__ maker, read archive content and decompress it +ARCHIVE=`awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' $0` +tail -n+$ARCHIVE $0 | tar xzv -C ${install_dir} +if [ ! $? -eq 0 ]; then + echo "Unable to extract installation files" + exit 1 +fi + # Default port echo -e "Specify default port for TASMAN (you can change it runtime) [8080]: \c" read default_port @@ -35,13 +65,6 @@ if [[ "$default_port" -lt "1024" ]]; then exit 1 fi -# Tasman installation dir -echo -e "Specify TASMAN installation directory [/opt/tasman]: \c" -read install_dir -if [[ -z "$install_dir" ]]; then - install_dir="/opt/tasman" -fi - # UCD service URL echo -e "Specify UCD service URL [http://ia2-vo.oats.inaf.it/ucd/]: \c" read ucd_service_url @@ -66,22 +89,6 @@ fi # useradd -r tasman #fi -# Creating installation directory -mkdir -p "$install_dir" -if [ ! $? -eq 0 ]; then - echo "Unable to create installation directory $install_dir" - exit 1 -fi - -# Add final slash to installation dir if it is necessary -if [[ "$install_dir" != *\/ ]]; then - install_dir="$install_dir/" -fi - -# Copying files -cp data/tasman-embedded.jar "$install_dir" -cp data/tasman-webapp.war "$install_dir" - cd $install_dir # Configuring tasman-embedded @@ -108,7 +115,7 @@ echo "java -jar $install_dir""tasman-embedded.jar \$1" >> $tasman_bin chmod +x $tasman_bin # Creating executable symbolic link -ln -s $tasman_bin /usr/bin/tasman +ln -sfn $tasman_bin /usr/bin/tasman # Setting permissions chmod -R 777 $tasman_config_dir @@ -117,3 +124,8 @@ echo "######################################" echo "# TASMAN installation completed! :-) #" echo "######################################" echo "Notice that $tasman_config_dir has 777 permissions. If you are planning to use TASMAN only with a specific user you may want to restrict permissions on that folder." + +# Exit from the script with success (0) +exit 0 + +__ARCHIVE__ diff --git a/test.properties.example b/test.properties.example new file mode 100644 index 0000000000000000000000000000000000000000..5e0b06c416c31759765b3669301568b86d5129e6 --- /dev/null +++ b/test.properties.example @@ -0,0 +1,12 @@ +# MySQL test database +mysql_host=localhost +mysql_port=3306 +mysql_user= +mysql_password= + +# Postgres test database +postgres_host=localhost +postgres_port=5432 +postgres_user= +postgres_password= +postgres_database= diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 0000000000000000000000000000000000000000..0b9ff46803808cf4cc60519309f9f3bf524362bf --- /dev/null +++ b/update_version.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Keep synchronized parent and children versions + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 <version>" + exit +fi + +version=$1 + +cd TASMAN-bom +mvn -q versions:set -DnewVersion=$version +mvn -q clean install +cd ../TASMAN-core +mvn -q versions:update-parent -DparentVersion=$version +cd ../TASMAN-webapp +mvn -q versions:update-parent -DparentVersion=$version +cd ../TASMAN-embedded +mvn -q versions:update-parent -DparentVersion=$version + +echo "Done"