Skip to content

Latest commit

 

History

History
109 lines (73 loc) · 2.1 KB

development.md

File metadata and controls

109 lines (73 loc) · 2.1 KB

Develop Minz

Setup Docker

The development environment is managed with Docker by default.

First, make sure to install Docker Engine. The docker command must be executable by your normal user.

Install the project

Clone the repository:

$ git clone [email protected]:flusio/Minz.git

Install the dependencies:

$ make install

A note about the make commands: they might feel magic, but they are not! They are just shortcuts for common commands. If you want to know what they do, you can open the Makefile and locates the command that you are interested in. They are hopefully easily readable by newcomers.

Working in the Docker containers

As the environment runs in Docker, you cannot run the php (or the others) directly. There are few scripts to allow to execute commands in the Docker containers easily:

$ ./docker/bin/php
$ ./docker/bin/composer

Running the tests

You can execute the tests with:

$ make test

Execute the tests of a specific file with the FILE= parameter:

$ make test FILE=tests/path/to/file.php

Filter tests with the FILTER= parameter (it takes a function name, or a part of it):

$ make test FILE=tests/path/to/file.php FILTER=testSomePattern

Code coverage

The previous command generates code coverage under the folder coverage/. To disable code coverage, run the command:

$ make test COVERAGE=

Running the linters

Execute the linters with:

$ make lint

You can run a specific linter with:

$ make lint LINTER=phpstan
$ make lint LINTER=rector
$ make lint LINTER=phpcs

Updating the development environment

Pull the changes with Git:

$ git pull

If dependencies have been added or updated, install them:

$ make install

Sometimes, you may also have to pull or rebuild the Docker images:

$ make docker-pull
$ make docker-build

If you encounter any problem with the Docker containers, you can clean them:

$ make docker-clean