Commit bdcbe713 authored by Emmanuel Duchastenier's avatar Emmanuel Duchastenier Committed by GitHub
Browse files

fix(scripts): make start/stop scripts launchable from everywhere (#346)

More precisely from another directory, instead of requiring to be
in root Bonita directory to launch start/stop-bonita.sh/.bat 

Closes [RUNTIME-297](https://bonitasoft.atlassian.net/browse/RUNTIME-297)
parent 44074823
@echo off
setlocal
set BASEDIR=%~dp0
echo BASEDIR: %BASEDIR%
:: Test if system variable JRE_HOME is set.
if "x%JRE_HOME%" == "x" (
echo JRE_HOME is not set. Trying to use JAVA_HOME instead...
......@@ -71,27 +74,27 @@ if "%VERSION_NUMBER%" NEQ "%VERSION_EXPECTED%" (
)
echo Java version is compatible
IF NOT EXIST setup GOTO NOSETUPDIR
IF NOT EXIST %BASEDIR%\setup GOTO NOSETUPDIR
echo ------------------------------------------------------
echo Initializing and configuring Bonita Tomcat bundle
echo ------------------------------------------------------
shift
call setup\setup.bat init %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
call %BASEDIR%\setup\setup.bat init %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
if errorlevel 1 (
goto exit
)
call setup\setup.bat configure %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
call %BASEDIR%\setup\setup.bat configure %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
if errorlevel 1 (
goto exit
)
:NOSETUPDIR
cd %BASEDIR%
cd server
echo "-----------------------------------------------------"
echo "Starting Bonita Tomcat bundle"
echo "-----------------------------------------------------"
call bin\startup.bat
cd ..
exit /b 0
:exit
......
#!/bin/sh
BASEDIR=$(cd $(dirname "$0") && pwd -P)
testReturnCode() {
COD_RET=$1
if [ ${COD_RET} -ne 0 ]; then
......@@ -35,15 +37,15 @@ if [ "$java_version" != "8" -a "$java_version" != "11" ]; then
fi
echo "Java version is compatible"
if [ -d "./setup" ]; then
if [ -d "${BASEDIR}/setup" ]; then
echo "------------------------------------------------------"
echo "Initializing and configuring Bonita Tomcat bundle"
echo "------------------------------------------------------"
./setup/setup.sh init $@
${BASEDIR}/setup/setup.sh init $@
testReturnCode $?
./setup/setup.sh configure $@
${BASEDIR}/setup/setup.sh configure $@
testReturnCode $?
fi
......@@ -51,4 +53,4 @@ fi
echo "------------------------------------------------------"
echo "Starting Bonita Tomcat bundle"
echo "------------------------------------------------------"
./server/bin/startup.sh
${BASEDIR}/server/bin/startup.sh
@echo off
setlocal
set BASEDIR=%~dp0
cd %BASEDIR%
cd server
call bin\shutdown.bat
cd ..
\ No newline at end of file
call bin\shutdown.bat
\ No newline at end of file
#!/bin/sh
./server/bin/shutdown.sh
BASEDIR=$(cd $(dirname "$0") && pwd -P)
${BASEDIR}/server/bin/shutdown.sh
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment