Skip to content

Commit 79febc5

Browse files
authored
Merge pull request #13389 from rabbitmq/mocha-dockerfile-configurable
Configure location of mocha-test dockerfile
2 parents 71a7b41 + c3da54c commit 79febc5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

selenium/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,10 @@ following command:
209209
```
210210
npm install
211211
```
212+
213+
## Build mocha-test image using a different Dockefile
214+
215+
```bash
216+
MOCHA_DOCKER_FILE=\location\of\my\Dockerfile ./run-suites.sh
217+
```
218+

selenium/bin/suite_template

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,15 @@ init_suite() {
128128
}
129129

130130
build_mocha_image() {
131-
begin "Ensuring mocha-test image ..."
131+
DOCKER_BUILD_ARGS=""
132+
if [[ -n "$MOCHA_DOCKER_FILE" ]]; then
133+
DOCKER_BUILD_ARGS="-f $MOCHA_DOCKER_FILE "
134+
fi
135+
begin "Ensuring mocha-test image ($DOCKER_BUILD_ARGS) ..."
132136
tag=($(md5sum $SELENIUM_ROOT_FOLDER/package.json))
133137
print "> tag : $tag"
134138
if [[ $(docker images -q mocha-test:$tag 2> /dev/null) == "" ]]; then
135-
docker build -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER
139+
docker build $DOCKER_BUILD_ARGS -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER
136140
print "> Built docker image mocha-test:$tag"
137141
fi
138142
end "mocha-test image exists"

0 commit comments

Comments
 (0)