Fix for Molecule images build-all.sh 04/86404/1
authorMateusz Pilat <m.pilat@partner.samsung.com>
Fri, 26 Apr 2019 14:15:29 +0000 (16:15 +0200)
committerMateusz Pilat <m.pilat@partner.samsung.com>
Fri, 26 Apr 2019 14:17:31 +0000 (16:17 +0200)
ansible/test/images/docker/build-all.sh works only if executed under folder where script is located.

Change-Id: Ic91656656788a48bdd12cb8003e875011a71cbe3
Issue-ID: OOM-1829
Signed-off-by: Mateusz Pilat <m.pilat@partner.samsung.com>
ansible/test/images/docker/build-all.sh

index dd5db09..dcaaf82 100755 (executable)
@@ -19,9 +19,9 @@
 #   COPYRIGHT NOTICE ENDS HERE
 
 BUILD_SCRIPT=${1:-build.sh}
-
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
 # Run all build scripts in direct subdirectories
-for buildfile in $(find -mindepth 2 -maxdepth 2 -name ${BUILD_SCRIPT});
+for buildfile in $(find ${SCRIPTPATH} -mindepth 2 -maxdepth 2 -name ${BUILD_SCRIPT});
 do
   pushd $(dirname ${buildfile})
   . ${BUILD_SCRIPT}