Skip to content

Commit bf9c951

Browse files
author
Sheyla Trudo
committed
fixup! Separate Build Changes
1 parent 3a4c7f9 commit bf9c951

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.pipelines/containers/container-template.steps.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ steps:
77
- bash: |
88
set -e
99
10+
BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT")
11+
echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT"
12+
1013
IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG")
1114
echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG"
1215
@@ -18,6 +21,7 @@ steps:
1821
displayName: "Get Image Name"
1922
env:
2023
VAR_ID: ${{ parameters.name }}
24+
MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context
2125
MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag
2226
MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path
2327
MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args
@@ -27,6 +31,7 @@ steps:
2731
inputs:
2832
image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }})
2933
dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }})
34+
path: $(BUILD_CONTEXT_${{ parameters.name }})
3035
buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }})
3136
enableNetwork: true # Optional. Default: false
3237
enablePull: false # Optional. Default: true

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ acncli-image-name: # util target to print the CNI manager image name.
337337
acncli-image-name-and-tag: # util target to print the CNI manager image name and tag.
338338
@echo $(IMAGE_REGISTRY)/$(ACNCLI_IMAGE):$(ACNCLI_PLATFORM_TAG)
339339

340+
acncli-image-build-context:
341+
$(eval BUILD_CONTEXT := $(REPO_ROOT))
342+
@echo "$(BUILD_CONTEXT)"
343+
340344
acncli-dockerfile-path:
341345
$(eval DOCKERFILE_PATH := $(ACNCLI_DIR)/Dockerfile)
342346
@echo "$(DOCKERFILE_PATH)"
@@ -371,6 +375,10 @@ azure-ipam-image-name: # util target to print the azure-ipam image name.
371375
azure-ipam-image-name-and-tag: # util target to print the azure-ipam image name and tag.
372376
@echo $(IMAGE_REGISTRY)/$(AZURE_IPAM_IMAGE):$(AZURE_IPAM_PLATFORM_TAG)
373377

378+
azure-ipam-image-build-context:
379+
$(eval BUILD_CONTEXT := $(REPO_ROOT))
380+
@echo "$(BUILD_CONTEXT)"
381+
374382
azure-ipam-dockerfile-path:
375383
$(eval DOCKERFILE_PATH := $(AZURE_IPAM_DIR)/Dockerfile)
376384
@echo "$(DOCKERFILE_PATH)"
@@ -408,6 +416,10 @@ ipv6-hp-bpf-image-name: # util target to print the ipv6-hp-bpf image name.
408416
ipv6-hp-bpf-image-name-and-tag: # util target to print the ipv6-hp-bpf image name and tag.
409417
@echo $(IMAGE_REGISTRY)/$(IPV6_HP_BPF_IMAGE):$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG)
410418

419+
ipv6-hp-bpf-image-build-context:
420+
$(eval BUILD_CONTEXT := $(REPO_ROOT))
421+
@echo "$(BUILD_CONTEXT)"
422+
411423
ipv6-hp-bpf-dockerfile-path:
412424
$(eval DOCKERFILE_PATH := $(IPV6_HP_BPF_DIR)/$(OS).Dockerfile)
413425
@echo "$(DOCKERFILE_PATH)"
@@ -445,6 +457,10 @@ cni-image-name: # util target to print the cni image name.
445457
cni-image-name-and-tag: # util target to print the cni image name and tag.
446458
@echo $(IMAGE_REGISTRY)/$(CNI_IMAGE):$(CNI_PLATFORM_TAG)
447459

460+
cni-image-build-context:
461+
$(eval BUILD_CONTEXT := $(REPO_ROOT))
462+
@echo "$(BUILD_CONTEXT)"
463+
448464
cni-image-dockerfile-path:
449465
$(eval DOCKERFILE_PATH := $(CNI_BUILD_DIR)/Dockerfile)
450466
@echo "$(DOCKERFILE_PATH)"
@@ -483,6 +499,10 @@ cns-image-name: # util target to print the CNS image name
483499
cns-image-name-and-tag: # util target to print the CNS image name and tag.
484500
@echo $(IMAGE_REGISTRY)/$(CNS_IMAGE):$(CNS_PLATFORM_TAG)
485501

502+
cns-image-build-context:
503+
$(eval BUILD_CONTEXT := $(REPO_ROOT))
504+
@echo "$(BUILD_CONTEXT)"
505+
486506
cns-image-dockerfile-path:
487507
$(eval DOCKERFILE_PATH := $(CNS_BUILD_DIR)/Dockerfile)
488508
@echo "$(DOCKERFILE_PATH)"
@@ -520,6 +540,10 @@ npm-image-name: # util target to print the NPM image name
520540
npm-image-name-and-tag: # util target to print the NPM image name and tag.
521541
@echo $(IMAGE_REGISTRY)/$(NPM_IMAGE):$(NPM_PLATFORM_TAG)
522542

543+
npm-image-build-context:
544+
$(eval BUILD_CONTEXT := $(REPO_ROOT))
545+
@echo "$(BUILD_CONTEXT)"
546+
523547
npm-image-dockerfile-path:
524548
$(eval DOCKERFILE_PATH := $(NPM_BUILD_DIR)/$(OS).Dockerfile)
525549
@echo "$(DOCKERFILE_PATH)"

0 commit comments

Comments
 (0)