-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.lb
50 lines (35 loc) · 1.69 KB
/
Makefile.lb
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
# Copyright (C) 2016--2020 Lightbits Labs Ltd.
# SPDX-License-Identifier: Apache-2.0
include $(WORKSPACE_TOP)/common/Makefile.env
DOCKER_REGISTRY := $(or $(DOCKER_REGISTRY),lbdocker:5000)
SIDECAR_DOCKER_REGISTRY := $(or $(SIDECAR_DOCKER_REGISTRY),lbdocker:5000)
REPO_NAME = los-csi
INSTALL_PATH ?= $(shell component-tool localpath --repo=$(REPO_NAME) --type=$(BUILD_TYPE) lb-csi-plugin)
ifeq ($(INSTALL_PATH),"")
$(error "lb-csi install path is not specified")
endif
override BUILD_HASH := $(shell component-tool version --repo $(REPO_NAME) --type=$(BUILD_TYPE) lb-csi-plugin)
override DISCOVERY_CLIENT_BUILD_HASH := $(shell component-tool version --repo discovery-client lb-nvme-discovery-client)
BUILD_FLAGS := DOCKER_REGISTRY=$(DOCKER_REGISTRY) \
SIDECAR_DOCKER_REGISTRY=$(SIDECAR_DOCKER_REGISTRY) \
BUILD_HASH=$(BUILD_HASH) \
DISCOVERY_CLIENT_BUILD_HASH=$(DISCOVERY_CLIENT_BUILD_HASH) \
HELM_CHART_REPOSITORY=$(HELM_CHART_REPOSITORY) \
HELM_CHART_REPOSITORY_USERNAME=$(HELM_CHART_REPOSITORY_USERNAME) \
HELM_CHART_REPOSITORY_PASSWORD=$(HELM_CHART_REPOSITORY_PASSWORD)
.PHONY: all checkout_deps build clean install_dir install checkin
all: docker-build docker-bundle install
checkout_deps:
$(Q)lb-build -d -o
clean:
$(Q)$(MAKE) -f Makefile clean
install_dir:
$(Q)mkdir -p $(INSTALL_PATH)
install: |install_dir
$(BUILD_FLAGS) $(MAKE) -f Makefile push
cp -r deploy $(INSTALL_PATH)/
$(call save_manifest,$(REPO_NAME):lb-csi-plugin,$(INSTALL_PATH))
checkin:
$(Q)component-tool checkin -v --repo=$(REPO_NAME) lb-csi-plugin
.DEFAULT: ## passthrough each command to the Makefile with predefined lightbits specific variables.
$(Q)$(BUILD_FLAGS) $(MAKE) --no-print-directory -f Makefile "$@"