Skip to content
Snippets Groups Projects
Verified Commit f9aab502 authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

[docker_test.sh] Fix logic for external volumes

parent d543f2eb
No related branches found
No related tags found
No related merge requests found
...@@ -44,9 +44,10 @@ if [[ -d "$1" ]]; then ...@@ -44,9 +44,10 @@ if [[ -d "$1" ]]; then
# Go to the folder of the service which will be tested # Go to the folder of the service which will be tested
cd "$1" cd "$1"
echo -e "\n==== Stop and remove existing containers ===="
create_dumb_secrets create_dumb_secrets
docker-compose down
echo -e "\n==== Stop and remove existing containers and volumes ===="
docker-compose down -v
cd .. cd ..
else else
echo "WARNING : directory does not exist ($1) ; will try to pull" echo "WARNING : directory does not exist ($1) ; will try to pull"
...@@ -82,9 +83,11 @@ done ...@@ -82,9 +83,11 @@ done
echo -e "\n==== Remove and re-create named external volumes ====" echo -e "\n==== Remove and re-create named external volumes ===="
for v in $(docker-compose config --volumes); do for v in $(docker-compose config --volumes); do
# Don't fail if volume does not exists if [ grep $v -A 1 docker-compose.yml | grep 'external' ]; then
docker volume rm "$v" || true # Don't fail if volume does not exists
docker volume create "$v" docker volume rm "$v" || true
docker volume create "$v"
fi
done done
echo -e "\n==== Remove old images ====" echo -e "\n==== Remove old images ===="
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment