From daeb79aecbde941be2ff7bf2ff8fac740d71c358 Mon Sep 17 00:00:00 2001 From: Grace Wehner Date: Sat, 9 Dec 2023 21:24:26 -0800 Subject: [PATCH] revert linux build --- .pipelines/azure-pipeline-build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index 99a2e29c5..f51cc7a5d 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -4,7 +4,7 @@ trigger: - main pr: - autoCancel: true + #autoCancel: true branches: include: - main @@ -308,9 +308,15 @@ jobs: docker buildx create --name dockerbuilder docker buildx use dockerbuilder - docker login containerinsightsprod.azurecr.io -u $(ACR_USERNAME) -p $(ACR_PASSWORD) - docker buildx build . --platform=linux/amd64,linux/arm64 --file ./build/linux/Dockerfile -t $(LINUX_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json --push - docker pull $(LINUX_FULL_IMAGE_NAME) + if [ "$(Build.Reason)" != "PullRequest" ]; then + docker buildx build . --platform=linux/amd64,linux/arm64 --file ./build/linux/Dockerfile -t $(LINUX_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json --push + docker pull $(LINUX_FULL_IMAGE_NAME) + else + # Build multiarch image to make sure there are no issues + docker buildx build . --platform=linux/amd64,linux/arm64 --file ./build/linux/Dockerfile -t $(LINUX_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json + # Load in amd64 image to run vulnerability scan + docker buildx build . --file ./build/linux/Dockerfile -t $(LINUX_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json + fi workingDirectory: $(Build.SourcesDirectory)/otelcollector/ displayName: "Build: build and push image to dev ACR"