From 13f35eb71cd48a36d3f85393ccf2d22710fe1151 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 18 Feb 2018 19:36:35 +0100 Subject: [PATCH] +add makefile.start and makefile.stop checks if the environment is already started/stopped --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index cfac4e0..6ccdb82 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ start: + @test "`docker-compose ps | wc -l`" -le "2" || (echo -e "/!\\ already running environment\n"; exit 1); @echo "> [1] pre-start script"; @bash ./metactl/pre-start.sh && echo "< done" || (echo "< failed"; exit 1); @echo; @@ -9,6 +10,7 @@ start: @bash ./metactl/post-start.sh && echo "< done" || (echo "< failed"; exit 1); start-no-cache: + @test "`docker-compose ps | wc -l`" -le "2" || (echo -e "/!\\ already running environment\n"; exit 1); @echo "> [1] pre-start script"; @bash ./metactl/pre-start.sh && echo "< done" || (echo "< failed"; exit 1); @echo; @@ -19,6 +21,7 @@ start-no-cache: @bash ./metactl/post-start.sh && echo "< done" || (echo "< failed"; exit 1); stop: + @test "`docker-compose ps | wc -l`" -gt "2" || (echo -e "/!\\ no running environment\n"; exit 1); @echo "> [1] pre-stop script"; @bash ./metactl/pre-stop.sh && echo "< done" || (echo "< failed"; exit 1); @echo;