From: danielhanrahan Date: Fri, 16 Aug 2024 14:47:57 +0000 (+0100) Subject: [k6] Always pull latest cps and dmi stub images X-Git-Tag: 3.5.3~57^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F138780%2F4;p=cps.git [k6] Always pull latest cps and dmi stub images Presently, k6 tests are using old cached DMI stub version in the Jenkins job. This commit ensures latest images are pulled by cleaning old images if a variable is set. Issue-ID: CPS-2368 Signed-off-by: danielhanrahan Change-Id: I66a749c7cdeb7daee06a00b06dff50ead6854f28 --- diff --git a/k6-tests/teardown.sh b/k6-tests/teardown.sh index 1b4d721a23..7693dc03a4 100755 --- a/k6-tests/teardown.sh +++ b/k6-tests/teardown.sh @@ -19,4 +19,10 @@ echo '================================== docker info ==========================' docker ps -a echo 'Stopping, Removing containers and volumes...' -docker-compose -f ../docker-compose/docker-compose.yml --profile dmi-stub down --volumes +docker_compose_cmd="docker-compose -f ../docker-compose/docker-compose.yml --profile dmi-stub down --volumes" +# Set an environment variable CLEAN_DOCKER_IMAGES=1 to also remove docker images when done (used on jenkins job) +if [ "${CLEAN_DOCKER_IMAGES:-0}" -eq 1 ]; then + $docker_compose_cmd --rmi all +else + $docker_compose_cmd +fi