-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (30 loc) · 1.11 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
CONTAINER_FRONT = angular
start-dev: env
docker compose -f docker-compose.dev.yml up
stop-dev:
docker compose -f docker-compose.dev.yml down
clean-dev: stop-dev
docker volume rm postgres-volume-dev | true
rm .env
re: clean-dev start-dev
start-prod: build-prod
docker compose -f docker-compose.prod.yml up
stop-prod:
docker compose -f docker-compose.prod.yml down
build-prod: env
docker compose -f docker-compose.prod.yml build
env:
@if [ ! -e .env ]; then \
printf "$(GREEN)Generate environment variables\n$(DEFAULT)"; \
sh create-env.sh; \
fi
cmd-dev:
docker exec -it $(CONTAINER_FRONT) sh
cmd-prod:
docker exec -it $(CONTAINER_FRONT)-prod sh
dump:
docker exec postgres-dev pg_dump --dbname=$(shell grep DATABASE_URL= .env | sed 's/DATABASE_URL=//') > postgres-init/dump.sql
pr:
@firefox https://github.com/t-h2o/matcha/pull/new/$(shell git rev-parse --abbrev-ref HEAD)
@git cliff origin/main..HEAD -o pr-description.md || docker run -t -v "$(shell pwd)":/app/ "orhunp/git-cliff" origin/main..HEAD -o pr-description.md
.PHONY: env start-dev stop-dev start-prod stop-prod build-prod cmd-dev cmd-prod