Skip to content

Commit

Permalink
Add Makefile.lb
Browse files Browse the repository at this point in the history
  • Loading branch information
husam-lb authored and muliby-lb committed Dec 26, 2024
1 parent b7370fa commit 72559fa
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Makefile.lb
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 "$@"

0 comments on commit 72559fa

Please sign in to comment.