# Makefile

## Reason

Great to simplify and standardize commons and repetitive tasks.

## Definitions

Following the patterns of the [definitions document][definitions-doc], every task related to 
the compilation os preparation of the server for execution will `build` as part of the name,
while tasks related to the execution itself will be call `run`.

## Common instructions

### Build

- `create-build-container`: creates the container for building, using `Dockerfile.build`

- `build`: build the server inside the container and gets the binary

- `build-loc`: calls `build` using local (`loc`) environment

- `build-dev`: calls `build` using development (`dev`) environment

- `build-stg`: calls `build` using staging (`stg`) environment

- `build-prd`: calls `build` using production (`prd`) environment

### Run

- `create-run-container`: creates the container for execution, using `Dockerfile.run`

- `run`: executes the app inside the container

- `run-loc`: calls `run` using local (`loc`) environment

- `run-dev`: calls `run` using development (`dev`) environment

- `run-stg`: calls `run` using staging (`stg`) environment

- `run-prd`: calls `run` using production (`prd`) environment

- `run-host`: executes the app without a container, directly on the local host

### Environment

- `set-loc`: defines the environment as "local" (`loc`)

- `set-dev`: defines the environment as "development" (`dev`)

- `set-stg`: defines the environment as "staging" (`stg`)

- `set-prd`: defines the environment as "production" (`prd`)

### Database

- `migrate`: executes the full migration of the database

### Tests

- `test`: executes the whole battery of tests

### Others

- `clean`: remove binaries and compiled files

[definitions-doc]: https://bitbucket.org/nemt/nemt-portal-api/blob/master/docs/wiki/01%20-%20Definitions.md