-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmakefile
35 lines (30 loc) · 1.32 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
include ../utils/meta.mk ../utils/help.mk
LATEST_TAG ?= latest
build-docker-cached: ##@devops Build the docker image using cached layers
build-docker-cached: ./Dockerfile
@docker build \
--build-arg hasura_graphql_migrations_dir=/hasura-migrations \
--build-arg hasura_graphql_metadata_dir=/hasura-metadata \
--cache-from $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(LATEST_TAG) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(VERSION) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(LATEST_TAG) \
.
build-docker: ##@devops Build the docker image
build-docker: ./Dockerfile
@docker build \
--build-arg hasura_graphql_migrations_dir=/hasura-migrations \
--build-arg hasura_graphql_metadata_dir=/hasura-metadata \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(VERSION) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(LATEST_TAG) \
.
pull-image: ##@devops Pull the latest image from registry for caching
pull-image:
@docker pull $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(LATEST_TAG) || true
push-image: ##@devops Push the freshly built image and tag with release or latest tag
push-image:
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(VERSION)
ifeq ($(strip $(RELEASE_TAG)),)
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(LATEST_TAG)
else
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_HASURA):$(RELEASE_TAG)
endif