65 lines
1.7 KiB
Makefile
65 lines
1.7 KiB
Makefile
.DEFAULT_GOAL := help
|
|
|
|
COMPOSE = docker compose -f docker-compose.yml -f docker-compose.override.yml
|
|
|
|
.PHONY: setup
|
|
setup: ## setup project
|
|
@mkdir -p priv/plts
|
|
@mix do local.rebar --force, local.hex --force
|
|
@mix do deps.get, deps.compile
|
|
@mix dialyzer --plt
|
|
|
|
.PHONY: check_format
|
|
check_format: ## run format checker
|
|
@mix format --check-formatted
|
|
|
|
.PHONY: credo
|
|
credo: ## run credo
|
|
@mix credo suggest --strict --format=flycheck
|
|
|
|
.PHONY: dialyzer
|
|
dialyzer: ## run dialyzer
|
|
@mix dialyzer --format short
|
|
|
|
.PHONY: static_code_analysis
|
|
static_code_analysis: check_format credo dialyzer ## run static code analysis
|
|
|
|
.PHONY: docs
|
|
docs: ## create documentation files
|
|
@mix docs
|
|
|
|
.PHONY: test
|
|
test: ## run tests
|
|
@mix test --cover --trace --slowest 10
|
|
|
|
.PHONY: compose_up
|
|
compose_up: ## start containers for this service
|
|
@$(COMPOSE) up -d
|
|
|
|
.PHONY: compose_watch
|
|
compose_watch: ## start containers for this service watching for updates in filesystem
|
|
@$(COMPOSE) up -w
|
|
|
|
.PHONY: compose_database_create
|
|
compose_database_create:
|
|
@$(COMPOSE) run --rm --entrypoint mix app ecto.create
|
|
|
|
.PHONY: compose_database_migrate
|
|
compose_database_migrate: ## apply migrations to our database
|
|
@$(COMPOSE) run --rm --entrypoint mix app ecto.migrate
|
|
|
|
.PHONY: compose_database_setup
|
|
compose_database_setup: compose_database_create compose_database_migrate ## create and apply migrations
|
|
|
|
.PHONY: compose_ps
|
|
compose_ps: ## status of containers
|
|
@$(COMPOSE) ps
|
|
|
|
.PHONY: compose_remote
|
|
compose_remote: ## connect to remote node
|
|
@$(COMPOSE) exec app ./priv/docker/service/docker-remote.sh
|
|
|
|
.PHONY: help
|
|
help:
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|