diff --git a/package.json b/package.json index 14525d3..c01aa9f 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "docker-lint": "LINT_COMMAND=lint docker-compose -f docker-compose-lint.yml up --abort-on-container-exit", "docker-lint:fix": "LINT_COMMAND=lint:fix docker-compose -f docker-compose-lint.yml up --abort-on-container-exit", "docker-test:all": "docker-compose -f docker-compose-test.yml up --abort-on-container-exit", - "docker-remove-all": "bash ./scripts/docker-remove-all.sh ch ch-dev-dep-test cd-testv1 code-hammers", + "docker-remove-all": "bash ./scripts/docker-remove-all.sh ch ch-dev-dep code-hammers", "docker-build-check": "bash ./scripts/build-check.sh", "test:client": "cd client && npm test", "test:all": "concurrently \"npm test\" \"npm run test:client\"" diff --git a/scripts/docker-remove-all.sh b/scripts/docker-remove-all.sh index 088446a..dcb7e55 100644 --- a/scripts/docker-remove-all.sh +++ b/scripts/docker-remove-all.sh @@ -15,8 +15,7 @@ echo '' CONTAINER_SEARCH_NAME=$1 IMAGE_SEARCH_NAME_DEV=$2 -IMAGE_SEARCH_NAME_TEST=$3 -VOLUME_SEARCH_NAME=$4 +VOLUME_SEARCH_NAME=$3 # Remove containers echo -e "${CYAN}Removing existing containers from local environment:${NC}" @@ -28,23 +27,9 @@ else echo 'Removed containers.' fi -# Remove dev images +# Remove images echo -e "${CYAN}Removing existing dev images from local environment:${NC}" -IMAGES=$(docker images codehammers/$IMAGE_SEARCH_NAME_DEV -q) -REMOVEDIMAGES=0 -if [ ! -z "$IMAGES" ]; then - docker rmi $IMAGES --force - REMOVEDIMAGES=1 -fi -if [ "$REMOVEDIMAGES" = 1 ]; then - echo 'Removed images.' -else - echo 'No images to remove.' -fi - -# Remove test images -echo -e "${CYAN}Removing existing dev images from local environment:${NC}" -IMAGES=$(docker images codehammers/$IMAGE_SEARCH_NAME_TEST -q) +IMAGES=$(docker images codehammers/$IMAGE_SEARCH_NAME_DEV* -q) REMOVEDIMAGES=0 if [ ! -z "$IMAGES" ]; then docker rmi $IMAGES --force @@ -58,7 +43,7 @@ fi # Remove volumes echo -e "${CYAN}Removing existing volumes from local environment:${NC}" -VOLUMES=$(docker volume ls -q -f name=$VOLUME_SEARCH_NAME) +VOLUMES=$(docker volume ls -q -f name=$VOLUME_SEARCH_NAME*) if [ ! -z "$VOLUMES" ]; then docker volume rm $VOLUMES --force echo 'Removed volumes.'