Skip to content

Commit 55c074a

Browse files
author
Sheyla Trudo
committed
fixup! Separate Build Changes
1 parent 97130bf commit 55c074a

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,30 @@ jobs:
2626
- task: GoTool@0
2727
inputs:
2828
version: $(GO_VERSION)
29-
30-
- task: AzureCLI@2
31-
displayName: "Docker Login"
32-
inputs:
33-
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
34-
scriptLocation: "inlineScript"
35-
scriptType: "bash"
36-
addSpnToEnvironment: true
37-
inlineScript: |
38-
ls -la /bin
39-
env:
40-
ACR: ${{ parameters.containerRegistry.name }}
4129

4230
- bash: |
4331
set -e
4432
4533
BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT")
4634
echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT"
4735
48-
IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG")
36+
IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG")
37+
echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG"
38+
39+
IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_NAME_AND_TAG")
4940
echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG"
5041
5142
DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH")
5243
echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH"
5344
5445
EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS")
5546
echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS"
56-
displayName: "Get Image Name"
47+
displayName: "Get Image Build Data"
5748
env:
5849
VAR_ID: ${{ image }}
50+
MAKE_IMAGE_TAG: ${{ image }}-image-tag
5951
MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context
60-
MAKE_IMG_NAME_AND_TAG: ${{ image }}-image-name-and-tag
52+
MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag
6153
MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path
6254
MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args
6355

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ steps:
2929
inputs:
3030
image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }})
3131
dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }})
32-
path: $(BUILD_CONTEXT_${{ parameters.name }})
33-
buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }})
32+
path: $(Build.SourcesDirectory)
33+
buildArguments: --platform "${{ parameters.os }}/${{ parameters.arch }}" --build-arg ARCH="${{ parameters.arch }}" --build-arg OS="${{ parameters.os }}" --build-arg PLATFORM="${{ parameters.os }}/${{ parameters.arch }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }})
3434
enableNetwork: true
3535
enablePull: false
3636
enableCache: true

.pipelines/trigger.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ extends:
4545
name: $(BUILD_POOL_NAME_DEFAULT)
4646
os: linux
4747
image: acn-runner-vmss-image-1es-v3.0
48+
featureFlags:
49+
automaticContainerPatching: true
4850
sdl:
4951
sourceAnalysisPool:
5052
name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS)

Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ acncli-dockerfile-path:
346346
@echo "$(DOCKERFILE_PATH)"
347347

348348
acncli-docker-build-args:
349-
$(eval DOCKER_BUILD_ARGS := ;)
349+
$(eval DOCKER_BUILD_ARGS := '')
350350
@echo $(DOCKER_BUILD_ARGS)
351351

352352
acncli-image: acncli-dockerfile-path acncli-build-args ## build cni-manager container image.
@@ -372,6 +372,9 @@ acncli-image-pull: ## pull cni-manager container image.
372372
azure-ipam-image-name: # util target to print the azure-ipam image name.
373373
@echo $(AZURE_IPAM_IMAGE)
374374

375+
azure-ipam-image-tag:
376+
@echo $(AZURE_IPAM_PLATFORM_TAG)
377+
375378
azure-ipam-image-name-and-tag: # util target to print the azure-ipam image name and tag.
376379
@echo $(IMAGE_REGISTRY)/$(AZURE_IPAM_IMAGE):$(AZURE_IPAM_PLATFORM_TAG)
377380

@@ -384,7 +387,7 @@ azure-ipam-dockerfile-path:
384387
@echo "$(DOCKERFILE_PATH)"
385388

386389
azure-ipam-docker-build-args:
387-
$(eval DOCKER_BUILD_ARGS := ;)
390+
$(eval DOCKER_BUILD_ARGS := '')
388391
@echo $(DOCKER_BUILD_ARGS)
389392

390393
azure-ipam-image: ## build azure-ipam container image.
@@ -413,6 +416,9 @@ azure-ipam-image-pull: ## pull azure-ipam container image.
413416
ipv6-hp-bpf-image-name: # util target to print the ipv6-hp-bpf image name.
414417
@echo $(IPV6_HP_BPF_IMAGE)
415418

419+
ipv6-hp-bpf-image-tag:
420+
@echo $(IPV6_HP_BPF_IMAGE_PLATFORM_TAG)
421+
416422
ipv6-hp-bpf-image-name-and-tag: # util target to print the ipv6-hp-bpf image name and tag.
417423
@echo $(IMAGE_REGISTRY)/$(IPV6_HP_BPF_IMAGE):$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG)
418424

@@ -425,7 +431,7 @@ ipv6-hp-bpf-dockerfile-path:
425431
@echo "$(DOCKERFILE_PATH)"
426432

427433
ipv6-hp-bpf-docker-build-args:
428-
$(eval DOCKER_BUILD_ARGS := '--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)')
434+
$(eval DOCKER_BUILD_ARGS := '--build-arg DEBUG=$(DEBUG)')
429435
@echo $(DOCKER_BUILD_ARGS)
430436

431437
ipv6-hp-bpf-image: ## build ipv6-hp-bpf container image.
@@ -454,6 +460,9 @@ ipv6-hp-bpf-image-pull: ## pull ipv6-hp-bpf container image.
454460
cni-image-name: # util target to print the cni image name.
455461
@echo $(CNI_IMAGE)
456462

463+
cni-image-tag:
464+
@echo $(CNI_PLATFORM_TAG)
465+
457466
cni-image-name-and-tag: # util target to print the cni image name and tag.
458467
@echo $(IMAGE_REGISTRY)/$(CNI_IMAGE):$(CNI_PLATFORM_TAG)
459468

@@ -496,6 +505,9 @@ cni-image-pull: ## pull cni container image.
496505
cns-image-name: # util target to print the CNS image name
497506
@echo $(CNS_IMAGE)
498507

508+
cns-image-tag:
509+
@echo $(CNS_PLATFORM_TAG)
510+
499511
cns-image-name-and-tag: # util target to print the CNS image name and tag.
500512
@echo $(IMAGE_REGISTRY)/$(CNS_IMAGE):$(CNS_PLATFORM_TAG)
501513

@@ -537,6 +549,9 @@ cns-image-pull: ## pull cns container image.
537549
npm-image-name: # util target to print the NPM image name
538550
@echo $(NPM_IMAGE)
539551

552+
npm-image-tag: # util target to print the NPM image name and tag.
553+
@echo $(NPM_PLATFORM_TAG)
554+
540555
npm-image-name-and-tag: # util target to print the NPM image name and tag.
541556
@echo $(IMAGE_REGISTRY)/$(NPM_IMAGE):$(NPM_PLATFORM_TAG)
542557

0 commit comments

Comments
 (0)