Build with Command Line Interface

(All this information is based on what the CI does)

We assume the current working directory is where Asqatasun source code is. For instance: /home/asqatasun/Asqatasun/

Prepare and build

MAVEN_CLI_OPTS="--batch-mode"
MAVEN_OPTS="-Dmaven.repo.local=.m2/repository"
./mvnw $MAVEN_CLI_OPTS validate
./mvnw $MAVEN_CLI_OPTS clean
./mvnw $MAVEN_CLI_OPTS install  -Dmaven.test.skip=true
./mvnw $MAVEN_CLI_OPTS test
sudo mkdir -p \
  /var/log/asqatasun/webapp/ \
  /var/log/asqatasun/server/

Run webapp

APP_PORT="8080"
DB_PORT="3307"
DB_HOST="localhost"
DB_DRIVER="mysql"
DB_DATABASE="asqatasun"
DB_USER="asqatasunDatabaseUserLogin"
DB_PASSWORD="asqatasunDatabaseUserP4ssword"
APP_LOG_DIR="/var/log/asqatasun/webapp"
WAR_FILE="/home/asqatasun/Asqatasun/web-app/asqatasun-web-app/target/asqatasun-web-app-5-SNAPSHOT.war"

sudo /usr/bin/java \
    -Dwebdriver.firefox.bin=/opt/firefox/firefox  \
    -Dwebdriver.gecko.driver=/opt/geckodriver     \
    -Dapp.logging.path="${APP_LOG_DIR}"           \
    -Djdbc.url="jdbc:${DB_DRIVER}://${DB_HOST}:${DB_PORT}/${DB_DATABASE}" \
    -Djdbc.user="${DB_USER}" \
    -Djdbc.password="${DB_PASSWORD}" \
    -jar "${WAR_FILE}"

Run server

APP_PORT="8080"
DB_PORT="3307"
DB_HOST="localhost"
DB_DRIVER="mysql"
DB_DATABASE="asqatasun"
DB_USER="asqatasunDatabaseUserLogin"
DB_PASSWORD="asqatasunDatabaseUserP4ssword"
APP_LOG_DIR="/var/log/asqatasun/server"
JAR_FILE="/home/asqatasun/Asqatasun/server/asqatasun-server/target/asqatasun-server-5-SNAPSHOT.jar"

sudo /usr/bin/java \
    -Dwebdriver.firefox.bin=/opt/firefox/firefox  \
    -Dwebdriver.gecko.driver=/opt/geckodriver     \
    -Dapp.logging.path="${APP_LOG_DIR}"           \
    -Djdbc.url="jdbc:${DB_DRIVER}://${DB_HOST}:${DB_PORT}/${DB_DATABASE}" \
    -Djdbc.user="${DB_USER}" \
    -Djdbc.password="${DB_PASSWORD}" \
    -jar "${JAR_FILE}"

Stop service

Just run a CTRL-C.