-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (34 loc) · 1015 Bytes
/
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
APP_VERSION = $(shell cat VERSION)
IMAGE_NAME = "dialect-map-ui"
SOURCE_FOLDER = "src"
TESTS_FOLDER = "tests"
GCP_PROJECT ?= "ds3-dialect-map"
GCP_REGISTRY ?= "us.gcr.io"
GCP_IMAGE_NAME = $(GCP_REGISTRY)/$(GCP_PROJECT)/$(IMAGE_NAME)
.PHONY: check
check:
@echo "Checking code format"
@npx prettier --check "$(SOURCE_FOLDER)/**/*.js"
@npx prettier --check "$(TESTS_FOLDER)/**/*.js"
.PHONY: build
build:
@echo "Building project"
@npm run build --silent
.PHONY: run
run:
@echo "Running development project"
@npm run start --silent
.PHONY: test
test:
@echo "Testing project"
@npx jest --noStackTrace $(TESTS_FOLDER)
.PHONY: docker-build
docker-build:
@echo "Building Docker image"
@docker build . --tag $(IMAGE_NAME):$(APP_VERSION)
.PHONY: docker-push
docker-push: docker-build
@echo "Pushing Docker image to GCP"
@docker tag $(IMAGE_NAME):$(APP_VERSION) $(GCP_IMAGE_NAME):$(APP_VERSION)
@docker push $(GCP_IMAGE_NAME):$(APP_VERSION)
@docker rmi $(GCP_IMAGE_NAME):$(APP_VERSION)