From 665ad58c35a0172208f73ff4fa7e58d745524496 Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Fri, 21 Feb 2025 11:33:26 +0100 Subject: [PATCH 1/2] Configure location of mocha-test dockerfile (cherry picked from commit 94c28d642b0f5aa2f9730663625c0ca810054b36) --- selenium/README.md | 7 +++++++ selenium/bin/suite_template | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/selenium/README.md b/selenium/README.md index c64a16403d29..2723d8a156e0 100644 --- a/selenium/README.md +++ b/selenium/README.md @@ -209,3 +209,10 @@ following command: ``` npm install ``` + +## Build mocha-test image using a different Dockefile + +```bash +MOCHA_DOCKER_FILE=\location\of\my\Dockerfile ./run-suites.sh +``` + diff --git a/selenium/bin/suite_template b/selenium/bin/suite_template index 33566190cb7b..7a64d6fc5d89 100644 --- a/selenium/bin/suite_template +++ b/selenium/bin/suite_template @@ -128,11 +128,15 @@ init_suite() { } build_mocha_image() { - begin "Ensuring mocha-test image ..." + DOCKER_BUILD_ARGS="" + if [[ -n "$MOCHA_DOCKER_FILE" ]]; then + DOCKER_BUILD_ARGS="-f $MOCHA_DOCKER_FILE " + fi + begin "Ensuring mocha-test image ($DOCKER_BUILD_ARGS) ..." tag=($(md5sum $SELENIUM_ROOT_FOLDER/package.json)) print "> tag : $tag" if [[ $(docker images -q mocha-test:$tag 2> /dev/null) == "" ]]; then - docker build -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER + docker build $DOCKER_BUILD_ARGS -f ${MOCHA_DOCKER_FILE} -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER print "> Built docker image mocha-test:$tag" fi end "mocha-test image exists" From 371118ad3a17d9834b9ba631f671a8cd79ba863d Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Fri, 21 Feb 2025 11:53:27 +0100 Subject: [PATCH 2/2] Remove duplicate flag (cherry picked from commit c3da54c3eae8ea9daf9b194bd9bc11847c9076ee) --- selenium/bin/suite_template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selenium/bin/suite_template b/selenium/bin/suite_template index 7a64d6fc5d89..fbccd71b952a 100644 --- a/selenium/bin/suite_template +++ b/selenium/bin/suite_template @@ -136,7 +136,7 @@ build_mocha_image() { tag=($(md5sum $SELENIUM_ROOT_FOLDER/package.json)) print "> tag : $tag" if [[ $(docker images -q mocha-test:$tag 2> /dev/null) == "" ]]; then - docker build $DOCKER_BUILD_ARGS -f ${MOCHA_DOCKER_FILE} -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER + docker build $DOCKER_BUILD_ARGS -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER print "> Built docker image mocha-test:$tag" fi end "mocha-test image exists"