Skip to content

Commit

Permalink
Allow simple-smoke-test.sh to be run multiple times (#745)
Browse files Browse the repository at this point in the history
`.github/scripts/simple-smoke-test.sh` creates and runs a container with
a default name (e.g. `hazelcast-oss`), but doesn't remove the container
afterwards, because later we query Docker for the logs.

This means when executed locally, subsequent invocations fail as the
container already exists.

Changed to remove the container if it already exists, before creation.
  • Loading branch information
JackPGreen authored May 3, 2024
1 parent fcf5028 commit 2c80196
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/scripts/simple-smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ set -o pipefail
function test_docker_image() {
local image=$1
local container_name=$2

if [ "$(docker ps --all --quiet --filter name="$container_name")" ]; then
echo "Removing existing '$container_name' container"
docker container rm --force "$container_name"
fi

echo "Starting container '$container_name' from image '$image'"
docker run -it --name "$container_name" -e HZ_LICENSEKEY -e HZ_INSTANCETRACKING_FILENAME -d -p5701:5701 "$image"
local key="some-key"
Expand Down

0 comments on commit 2c80196

Please sign in to comment.