From 963bbacb2d140b4f2cf1c79f9ddaf673d22052f9 Mon Sep 17 00:00:00 2001 From: Aly Nathoo <98403872+anathoodell@users.noreply.github.com> Date: Tue, 28 Jan 2025 11:19:33 -0500 Subject: [PATCH] Get csm-base-image instead of building it. (#402) * Get csm-base-image instead of building it. --- .github/workflows/release.yaml | 2 +- Makefile | 4 ++-- docker.mk | 13 ++++--------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 03ebaf57..25e1e6ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,7 @@ name: Release CSI-Powerflex # Invocable as a reusable workflow # Can be manually triggered -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy workflow_call: workflow_dispatch: inputs: diff --git a/Makefile b/Makefile index 5f30ccfd..e22cfeac 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,11 @@ build: dependencies # Generates the docker container (but does not push) docker: dependencies - make -f docker.mk build-base-image docker + make -f docker.mk docker # Generates the docker container with no cache (but does not push) docker-no-cache: dependencies - make -f docker.mk build-base-image docker-no-cache + make -f docker.mk docker-no-cache # Pushes container to the repository push: docker diff --git a/docker.mk b/docker.mk index d32d9c8f..16cce740 100644 --- a/docker.mk +++ b/docker.mk @@ -15,12 +15,13 @@ IMAGETAG="v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" endif -docker: +docker: download-csm-common + $(eval include csm-common.mk) @echo "Base Images is set to: $(BASEIMAGE)" @echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - $(BUILDER) build $(NOCACHE) -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --target $(BUILDSTAGE) --build-arg GOPROXY --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . + $(BUILDER) build --pull $(NOCACHE) -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --target $(BUILDSTAGE) --build-arg GOPROXY --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . -docker-no-cache: +docker-no-cache: download-csm-common @echo "Building with --no-cache ..." @make docker NOCACHE=--no-cache @@ -28,12 +29,6 @@ push: @echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" $(BUILDER) push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -build-base-image: download-csm-common - $(eval include csm-common.mk) - @echo "Building base image from $(DEFAULT_BASEIMAGE) and loading dependencies..." - ./scripts/build_ubi_micro.sh $(DEFAULT_BASEIMAGE) - @echo "Base image build: SUCCESS" - $(eval BASEIMAGE=localhost/csipowerflex-ubimicro:latest) download-csm-common: curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk