diff --git a/.gitattributes b/.gitattributes index e9711af..55fd762 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,4 @@ /.styleci.yml export-ignore /phpunit.xml.dist export-ignore /docker-compose.yml export-ignore -/setup.sh export-ignore -/start.sh export-ignore -/test.sh export-ignore +/Makefile export-ignore \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8fc6242 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: up setup start test + +up: docker-compose.yml + docker-compose up -d --force-recreate + +setup: docker-compose.yml composer.json + docker-compose run --rm php-cli composer install + +start: up + docker exec -ti mb_php bash + +test: docker-compose.yml phpunit.xml.dist + docker-compose run --rm php-cli bash -c "sleep 3 && bin/phpunit -c phpunit.xml.dist" diff --git a/README.MD b/README.MD index ca478bc..2dac097 100644 --- a/README.MD +++ b/README.MD @@ -122,14 +122,14 @@ If you like docker, this repository is provided with a dev environment with some All you need is docker and docker-compose installed on your system. ``` - ./setup.sh # will build the needed containers and setup the project + make setup # will build the needed containers and setup the project ``` ``` - ./start.sh # will start the needed containers and put you inside the php-cli container + make start # will start the needed containers and put you inside the php-cli container ``` ``` - ./test.sh # will launch the test suite + make test # will launch the test suite ``` Note: All these scripts are meant to be used outside the containers. diff --git a/setup.sh b/setup.sh deleted file mode 100755 index a954ee1..0000000 --- a/setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -docker-compose up -d --force-recreate -docker exec -ti mb_php composer install -docker-compose stop diff --git a/start.sh b/start.sh deleted file mode 100755 index 4f5ffb0..0000000 --- a/start.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -docker-compose up -d --force-recreate -docker exec -ti mb_php bash diff --git a/test.sh b/test.sh deleted file mode 100755 index 16c7689..0000000 --- a/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -docker-compose start -docker exec -ti mb_php bin/phpunit -c phpunit.xml.dist