Skip to content

Commit

Permalink
Merge pull request rabbitmq#13389 from rabbitmq/mocha-dockerfile-conf…
Browse files Browse the repository at this point in the history
…igurable

Configure location of mocha-test dockerfile
  • Loading branch information
Zerpet authored Feb 21, 2025
2 parents 71a7b41 + c3da54c commit 79febc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions selenium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

8 changes: 6 additions & 2 deletions selenium/bin/suite_template
Original file line number Diff line number Diff line change
Expand Up @@ -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 -t mocha-test:$tag --target test $SELENIUM_ROOT_FOLDER
print "> Built docker image mocha-test:$tag"
fi
end "mocha-test image exists"
Expand Down

0 comments on commit 79febc5

Please sign in to comment.