forked from polarismesh/polaris-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (21 loc) · 1.17 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
.PHONY: build
REGISTRY = ""
REPO = polarismesh/polaris-controller
SIDECAR_INIT_REPO = polarismesh/polaris-sidecar-init
ENVOY_SIDECAR_INIT_REPO = polarismesh/polaris-envoy-bootstrap-generator
IMAGE_TAG = v1.2.2
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o ./bin/polaris-controller ./cmd/polaris-controller/main.go
build-image:
docker build . -f ./docker/Dockerfile -t $(REGISTRY)$(REPO):$(IMAGE_TAG)
build-sidecar-init:
docker build ./sidecar/polaris-sidecar-init -f ./sidecar/polaris-sidecar-init/Dockerfile -t $(REGISTRY)$(SIDECAR_INIT_REPO):$(IMAGE_TAG)
build-envoy-sidecar-init:
docker build ./sidecar/envoy-bootstrap-config-generator -f ./sidecar/envoy-bootstrap-config-generator/Dockerfile -t $(REGISTRY)$(ENVOY_SIDECAR_INIT_REPO):$(IMAGE_TAG)
push-image-withlogin: build build-image build-sidecar-init login push-image
push-image: build build-image build-sidecar-init build-envoy-sidecar-init
docker push $(REGISTRY)$(REPO):$(IMAGE_TAG)
docker push $(REGISTRY)$(SIDECAR_INIT_REPO):$(IMAGE_TAG)
docker push $(REGISTRY)$(ENVOY_SIDECAR_INIT_REPO):$(IMAGE_TAG)
login:
@docker login --username=$(DOCKER_USER) --password=$(DOCKER_PASS) $(REGISTRY)