-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.dk
34 lines (26 loc) · 1.15 KB
/
Makefile.dk
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
##@ Docker
ALI_REGISTRY ?= registry.cn-hangzhou.aliyuncs.com
ALI_REGISTRY_NAMESPACE ?= pandora-io
ALI_REGISTRY_USER ?= "qijing89760"
ALI_REGISTRY_PASSWORD ?= "pandora12345"
IMAGE_NAME ?= tracer
BUILDER_IMAGE_NAME ?= tracer-builder
IMAGE_TAG ?= $(shell git rev-parse --short HEAD)
BUILDER_IMAGE_TAG ?= v1.0.0
TRACER_IMAGE_FULL_NAME ?= $(ALI_REGISTRY)/$(ALI_REGISTRY_NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)
BUILDER_IMAGE_FULL_NAME ?= $(ALI_REGISTRY)/$(ALI_REGISTRY_NAMESPACE)/$(BUILDER_IMAGE_NAME):$(BUILDER_IMAGE_TAG)
.PHONY: login
login: ## Login to the registry
@docker login -u $(ALI_REGISTRY_USER) -p $(ALI_REGISTRY_PASSWORD) $(ALI_REGISTRY)
.PHONY: push
push: login ## Push the tracer & builder image to the registry
@docker push $(TRACER_IMAGE_FULL_NAME) && docker push $(BUILDER_IMAGE_FULL_NAME)
.PHONY: build-tracer
build-tracer: ## Build the docker image
@docker build -t $(TRACER_IMAGE_FULL_NAME) .
.PHONY: build-builder
build-builder: ## build or download the builder.
@if [ -z "$(shell docker images -q $(BUILDER_IMAGE_FULL_NAME))" ]; then \
cd builder/compiler && docker build -t $(BUILDER_IMAGE_FULL_NAME) .; \
fi;\
echo "builder image is ready."