-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.51 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
STARTUP_PROJECT := TestePratico.Web
SERVICES_PROJECT := TestePratico.Services
DATA_PROJECT := TestePratico.Data
MIGRATION_NAME :=
.PHONY: deps
deps:
dotnet tool install --global dotnet-ef
dotnet restore
docker-compose pull
.PHONY: start-database
start-database:
docker-compose up -d
.PHONY: start-web
start-web:
dotnet run --project ./$(STARTUP_PROJECT);
.PHONY: watch-web
watch-web:
dotnet watch --project ./$(STARTUP_PROJECT);
.PHONY: start-services
start-services:
dotnet run --project ./$(SERVICES_PROJECT);
.PHONY: watch-services
watch-services:
dotnet watch --project ./$(SERVICES_PROJECT);
.PHONY: add-migration
add-migration:
@test -n "$(MIGRATION_NAME)" || (echo "MIGRATION_NAME must be defined" ; exit 1);
cd $(STARTUP_PROJECT) && \
dotnet ef migrations add "$(MIGRATION_NAME)" \
--project=../$(DATA_PROJECT) \
--output-dir=../$(DATA_PROJECT)/Migrations;
.PHONY: remove-migration
remove-migration:
cd $(STARTUP_PROJECT) && \
dotnet ef migrations remove --project ../$(DATA_PROJECT);
.PHONY: revert-to-migration
revert-to-migration:
@test -n "$(MIGRATION_NAME)" || (echo "MIGRATION_NAME must be defined" ; exit 1);
cd $(STARTUP_PROJECT) && \
dotnet ef database update "$(MIGRATION_NAME)" \
--project=../$(DATA_PROJECT);
.PHONY: update-database
update-database:
cd $(STARTUP_PROJECT) && \
dotnet ef database update --project ../$(DATA_PROJECT);
.PHONY: drop-database
drop-database:
cd $(STARTUP_PROJECT) && \
dotnet ef database drop --project ../$(DATA_PROJECT);
.PHONY: tests
tests:
dotnet test