From 366985da64c3e65da4cae5f9f47a430ffd9fcd96 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 19 Feb 2018 15:01:14 +0100 Subject: [PATCH] +add makefile.ci with file trigger (php-fpm container #2 will rm) --- .gitignore | 1 + Makefile | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c72a9dc..7302b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /Dockerfile /virtual/var/log +/virtual/trigger /metactl/persistent/* \ No newline at end of file diff --git a/Makefile b/Makefile index 6ccdb82..8fecc1e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ start-no-cache: @bash ./metactl/pre-start.sh && echo "< done" || (echo "< failed"; exit 1); @echo; @echo "> [2] Build & launch environment"; - @docker-compose up --force-recreate --build -d > /dev/null 2>&1 && echo "< done" || (echo "< failed"; exit 1); + @docker-compose up --force-recreate -d > /dev/null 2>&1 && echo "< done" || (echo "< failed"; exit 1); @echo; @echo "> [3] post-start script"; @bash ./metactl/post-start.sh && echo "< done" || (echo "< failed"; exit 1); @@ -29,4 +29,30 @@ stop: @docker-compose down > /dev/null 2>&1 && echo "< done" || (echo "< failed"; exit 1); @echo; @echo "> [3] post-stop script"; - @bash ./metactl/post-stop.sh && echo "< done" || (echo "< failed"; exit 1); \ No newline at end of file + @bash ./metactl/post-stop.sh && echo "< done" || (echo "< failed"; exit 1); + + +ci: + @echo "*************************"; + @echo "* *"; + @echo "* Launching CI loop *"; + @echo "* *"; + @echo "*************************"; + @echo; + @echo -n "*** Create trigger............."; + @touch ./virtual/trigger && echo "done" || (echo "error"; exit 1); + @echo; + @echo "*** Launch environment.........launching"; + @make start-no-cache | sed 's/^\(.\)/\t\1/g' || (exit 1); + @echo; + @echo "*** Wait for trigger...........waiting"; + @while [ -f ./virtual/trigger ]; do sleep 1; done; + @echo; + @echo "*** Remove environment.........removing"; + @make stop; + @echo; + @echo -n "*** Update source.............."; + @git pull origin master > /dev/null 2>&1 && echo "updated" || echo "failed"; + @echo; + @echo "*** Launch CI loop again"; + @make ci;