X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fgeode%2Fapache-geode-test%2Fexecute_tests.sh;h=4c134fb48d8ac0fc13114c060c558eeac60ba59c;hb=d643ea7acf4cd3e57ba89f092d39e0874b8b111c;hp=d0371d291208a5a5a83ab3b46897eaffeb23028b;hpb=5fe5de7dbaf93789b5fd852e7e711a388a034f07;p=infra%2Fcicd.git diff --git a/jjb/geode/apache-geode-test/execute_tests.sh b/jjb/geode/apache-geode-test/execute_tests.sh index d0371d29..4c134fb4 100755 --- a/jjb/geode/apache-geode-test/execute_tests.sh +++ b/jjb/geode/apache-geode-test/execute_tests.sh @@ -90,3 +90,13 @@ EXEC_COMMAND="bash -c 'echo Building with: $SEP \ GRADLE_JVM=${JAVA_BUILD_PATH} ./gradlewStrict ${GRADLE_ARGS}'" echo "${EXEC_COMMAND}" eval "${EXEC_COMMAND}" + +# Cleanup +# Make sure all test containers are stopped and removed when tests are finished +DOCKER_CONTAINERS=$(sudo docker ps -a -q 2> /dev/null) +if [ -n "${DOCKER_CONTAINERS}" ]; then + docker stop ${DOCKER_CONTAINERS} > /dev/null + echo -e "Removing containers with ID:" + docker rm ${DOCKER_CONTAINERS} +fi +