generated from LBHackney-IT/lbh-base-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (33 loc) · 1.13 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
.PHONY: setup
setup:
docker-compose build
.PHONY: build
build:
docker-compose build project-finder-api
.PHONY: serve
serve:
docker-compose build project-finder-api && docker-compose up -d dev-database
-dotnet tool install -g dotnet-ef
CONNECTION_STRING="Host=127.0.0.1;Port=5432;Username=postgres;Password=mypassword;Database=testdb" dotnet ef database update -p ProjectFinderApi
docker-compose up project-finder-api
.PHONY: shell
shell:
docker-compose run project-finder-api bash
.PHONY: test
test:
docker-compose build project-finder-api-test && docker-compose up project-finder-api-test
.PHONY: lint
lint:
-dotnet tool install -g dotnet-format
dotnet tool update -g dotnet-format
dotnet format
.PHONY: migrate-test-db
migrate-test-db:
-dotnet tool install -g dotnet-ef
CONNECTION_STRING="Host=127.0.0.1;Port=5432;Username=postgres;Password=mypassword;Database=testdb" dotnet ef database update -p ProjectFinderApi
.PHONY: restart-db
restart-db:
docker stop $$(docker ps -q --filter ancestor=test-database -a)
-docker rm $$(docker ps -q --filter ancestor=test-database -a)
docker rmi test-database
docker-compose up -d test-database