Skip to content

Makefile

Chris Matheny edited this page Apr 10, 2017 · 2 revisions

Makefile

All commands should be run from the root directory of the repository, or using the -C <Path-To-Repo> flag.

Initial Setup

make up

This command prepares and starts the development environment. First, it will build the API jar and Docker image. If a pgdata Docker volume does not already exist, it will be created using the SQL scripts in the ./sql folder. Finally, the database and API containers are started and networked together using docker-compose. This command is used for initial setup as well as starting up the environment after using make down.

To automatically follow the logs of the Docker containers when startup is complete:

make up-i

Rebuild and run the API

make dev

This command will shut down, build, and run the API with any new changes to the .java files. Testing is skipped with this command to allow faster builds.

To automatically follow the logs of the API Docker container:

make dev-i

Build the API

make build

This command will stop the API container and rebuild it.

Build the API jar only:

make build-maven

Test the API

make test

This command will run the maven test goals for the API.

Show the Docker Logs

Show logs for the API only:

make logs

Show logs for the database only:

make logs-db

Show logs for both:

make logs-all

Shut down the development environment

make down

This command will stop the Docker containers for both the API and the Postgres database. Changes made to the local database will be saved on the pgdata Docker volume.

Uninstall the development environment

make clean

This command will stop all Docker containers, remove the API build artifacts, and delete the local Postgres volume. Any changes to the database will be lost, and it will be re-initialized to the scripts in the ./sql folder the next time make up is run.

Clone this wiki locally