-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (21 loc) · 968 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SHELL := bash
.ONESHELL:
MAKEFLAGS += --no-builtin-rules
.PHONY: help build-dev run-dev run-dev-infra stop-dev
export APP_NAME := web-api-rs
export BRANCH_NAME := $(git branch --show-current)
NOCACHE := $(if $(NOCACHE),"--no-cache")
help: ## List all available targets with help
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build-dev: ## Build develop containers
@docker build ${NOCACHE} --pull -f ./build/Dockerfile -t ${APP_NAME}:latest .
@docker build ${NOCACHE} --pull -f ./build/helper.Dockerfile -t helper:latest .
run-dev-infra:
@docker-compose up -d postgres
dev-migration-up: ## Up all migrations to local database
@docker-compose run --rm helper sqlx migrate run
run-dev: run-dev-infra dev-migration-up ## Run service in develop environment
@docker-compose up -d app
stop-dev: ## Stop develop environment
@docker-compose down && docker volume rm app