From dacc217afe3e4ae9f1bda96a285929016204701e Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Fri, 16 Aug 2024 15:47:57 +0100 Subject: [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 --- k6-tests/teardown.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'k6-tests/teardown.sh') 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 -- cgit 1.2.3-korg