-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (37 loc) · 1.27 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
47
48
# APPLICATION
# --------------------------------------------------
.PHONY : build, up, down, test
# Rebuild and run all services detached
build :
docker compose --profile cchc build
# Starts just the api profile
up :
docker compose --profile api --force-recreate --detach
# Stops ALL profiles
down :
docker compose --profile db --profile cchc down
test :
go test -v ./...
# DATABASE
# --------------------------------------------------
.PHONY : migration, db-up, db-down
# Create a new migration
migration :
@read -p "What is the slug for the migration? " migration;\
migrate create -dir common/db/migrations -ext sql -seq $$migration
db-up :
@echo "Migrating to current version of database"
migrate -database "$(CCHC_DBSTR_LOCAL)" -path common/db/migrations up
db-down :
migrate -database "$(CCHC_DBSTR_LOCAL)" -path common/db/migrations down 1
# DEPLOY
# --------------------------------------------------
.PHONY : deploy
deploy : export CCHC_VERSION=release
deploy :
docker compose --profile cchc build --parallel
docker push ghcr.io/lmullen/cchc-crawler:release
docker push ghcr.io/lmullen/cchc-itemmd:release
docker push ghcr.io/lmullen/cchc-ctrl:release
docker push ghcr.io/lmullen/cchc-language-detector:release
docker push ghcr.io/lmullen/cchc-predictor:release