-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (42 loc) · 1.31 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
45
46
47
48
49
50
SHELL=/bin/bash
REGISTRY := $(or $(REG),docker.io)
REPOSITORY := $(or $(REPO),dayuhub)
IMAGE_REPO ?= $(REGISTRY)/$(REPOSITORY)
IMAGE_TAG ?= $(or $(TAG),v1.0)
#$(info "REGISTRY = $(REGISTRY)")
#$(info "REPOSITORY = $(REPOSITORY)")
#$(info "IMAGE_TAG = $(IMAGE_TAG)")
.EXPORT_ALL_VARIABLES:
define BUILD_HELP_INFO
# Build Docker images using the build.sh script in the "hack" folder.
#
# Usage:
# make build WHAT=component
# make all
# make help
#
# Components:
# backend, frontend, datasource, generator, distributor, controller, monitor, scheduler, car-detection, etc.
#
# Example:
# make build WHAT=monitor,generator
# make all
# make help
endef
.PHONY: build all help
help:
@echo "$${BUILD_HELP_INFO}"
# Build images
build:
@echo "Running build images of $(WHAT)"
@echo "Current registry is: $(REGISTRY)"
@echo "Current repository is: $(REPOSITORY)"
@echo "Current image tag is: $(IMAGE_TAG)"
bash hack/make-rules/cross-build.sh --files $(WHAT) --tag $(IMAGE_TAG) --repo $(REPOSITORY) --registry $(REGISTRY)
# Build all images
all:
@echo "Running build images of $(WHAT)"
@echo "Current registry is: $(REGISTRY)"
@echo "Current repository is: $(REPOSITORY)"
@echo "Current image tag is: $(IMAGE_TAG)"
bash hack/make-rules/cross-build.sh --tag $(IMAGE_TAG) --repo $(REPOSITORY) --registry $(REGISTRY)