ddd-leaven-akka-v2 icon indicating copy to clipboard operation
ddd-leaven-akka-v2 copied to clipboard

Allow running the run-* scripts from the project root directory.

Open seesiva opened this issue 8 years ago • 5 comments

Thanks for excellent content on this topic. I'm trying to run the application in the physical server in Ubuntu 14.04. I successfully completed till SBT Stage.

When I attempt to run the application using /common/run-scripts/run-all I'm getting the following error recorded in the log ./run-sales-write-back: line 3: ../../sales/write-back/target/universal/stage/bin/sales-write-back: No such file or directory

Similar errors in the other log files as well. What could be wrong from my end, Advice.

seesiva avatar Jul 26 '16 00:07 seesiva

You need to run the script from the run-scripts directory (cd ./common/run-scripts && ./run-all).

pawelkaczor avatar Jul 26 '16 08:07 pawelkaczor

I tried to run the scripts with ./run-all from ./commons/run-scripts directory it run but the ./target folder has 9 log files: invoicing-write-back.log, invoicing-write-front.log, sales-read-back.log, sales-read-front.log, sales-write-back.log,sales-write-front.log, shipping-read-back.log, shipping-read-front.log and shipping-write-back.log

For example it shows shipping-write-back.log file has the following content: ./run-shipping-write-back: line 3: ../../shipping/write-back/target/universal/stage/bin/shipping-write-back: No such file or directory

seesiva avatar Jul 26 '16 15:07 seesiva

Let's discuss this on chat: https://gitter.im/pawelkaczor/akka-ddd

pawelkaczor avatar Jul 26 '16 15:07 pawelkaczor

Declare a variable that represent the location of the current Bash script:

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Then use it in the script:

cp ${DIR}/file ${DIR}/../../../somewhere/else
${DIR}/../other-dir/another-script ${DIR}/../conf/my-conf.conf

This allow launching the script from anywhere.

ronanM avatar Mar 18 '17 10:03 ronanM

Thanks @ronanM.

pawelkaczor avatar Mar 19 '17 12:03 pawelkaczor