-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (30 loc) · 1.47 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
PROJECT_NAME := tl
TAG_PREFIX := registry.dka.services/$(PROJECT_NAME)
ref-books-db-up ref-books-api-up cbc-report-api-up client-up:
@pwsh dev/scripts/net-up.ps1 -project $(PROJECT_NAME)
@pwsh dev/scripts/up.ps1 -project $(PROJECT_NAME) -component $(subst -up,,$@)
ref-books-db-down ref-books-api-down cbc-report-api-down client-down:
@pwsh dev/scripts/down.ps1 -project $(PROJECT_NAME) -component $(subst -down,,$@)
@pwsh dev/scripts/net-down.ps1 -project $(PROJECT_NAME)
ref-books-db-log ref-books-api-log cbc-report-api-log client-log:
@docker logs -f $(PROJECT_NAME)_$(subst -,_,$(subst -log,,$@))
ref-books-db-drop ref-books-db-update ref-books-migrations-add ref-books-migrations-list ref-books-migrations-remove:
$(eval cmd:= $(subst ref-books-,,$@))
@cd server && pwsh tools/ef/$(cmd).ps1 \
-startup src/Services/ReferenceBook/ReferenceBook.Api \
-project src/Services/ReferenceBook/ReferenceBook.Api \
-context ReferenceBookContext
publish-ref-books-api:
$(call publish,ref-books-api,server,src/Services/ReferenceBook/ReferenceBook.Api/Dockerfile)
publish-cbc-report-api:
$(call publish,cbc-report-api,server,src/Services/Cbc.Report/TaxLegal.Cbc.Report.Api/Dockerfile)
publish-client:
$(call publish,client,client,Dockerfile)
define publish
@$(eval image := $(1))
@$(eval context := $(2))
@$(eval dockerfile := $(3))
@docker build -t $(TAG_PREFIX)/$(image) -f $(context)/$(dockerfile) $(context)
@docker push $(TAG_PREFIX)/$(image)
endef
.PHONY: $(MAKECMDGOALS)