-
Notifications
You must be signed in to change notification settings - Fork 16
/
makefile
44 lines (36 loc) · 1.42 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
include ../utils/meta.mk ../utils/help.mk
LATEST_TAG ?= latest
install: ##@local Install all dependencies
install:
@yarn install
clean-install: ##@local Reinstalls all dependencies
clean-install:
@rm -Rf node_modules
@yarn install
run: ##@local Run the project locally (without docker)
run: node_modules
@$(SHELL_EXPORT) yarn run dev
build-docker: ##@devops Build the docker image
build-docker: ./Dockerfile
@docker pull $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(VERSION) || true
@docker build \
--cache-from $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(VERSION) \
--target run-stage \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(VERSION) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(LATEST_TAG) \
.
pull-image: ##@devops Pull the latest image from registry for caching
pull-image:
@docker pull $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(LATEST_TAG) || true
build-docker-cached: ##@devops Build the docker image using cached layers
build-docker-cached: ./Dockerfile
@docker build \
--target prod-stage \
--cache-from $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(LATEST_TAG) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(VERSION) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(LATEST_TAG) \
.
push-image: ##@devops Push the freshly built image and tag with release or latest tag
push-image:
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(VERSION)
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_WALLET):$(LATEST_TAG)