diff --git a/eng/common/templates/jobs/post-build.yml b/eng/common/templates/jobs/post-build.yml index d470a641..31ad2eff 100644 --- a/eng/common/templates/jobs/post-build.yml +++ b/eng/common/templates/jobs/post-build.yml @@ -17,6 +17,8 @@ jobs: - template: /eng/common/templates/steps/download-build-artifact.yml@self parameters: targetPath: $(Build.ArtifactStagingDirectory) + # This can fail if no build jobs ran to produce any artifacts + continueOnError: true - powershell: | # Move all image-info artifacts to their own directory New-Item -ItemType Directory -Path $(imageInfosHostDir) diff --git a/eng/common/templates/jobs/publish.yml b/eng/common/templates/jobs/publish.yml index 3920beef..048d4286 100644 --- a/eng/common/templates/jobs/publish.yml +++ b/eng/common/templates/jobs/publish.yml @@ -107,21 +107,22 @@ jobs: - script: mkdir -p $(Build.ArtifactStagingDirectory)/eol-annotation-data displayName: Create EOL Annotation Data Directory - script: > - $(runImageBuilderCmd) publishImageInfo - '$(imageInfoContainerDir)/image-info.json' - '$(gitHubVersionsRepoInfo.userName)' - '$(gitHubVersionsRepoInfo.email)' - '$(gitHubVersionsRepoInfo.accessToken)' - --git-owner '$(gitHubVersionsRepoInfo.org)' - --git-repo '$(gitHubVersionsRepoInfo.repo)' - --git-branch '$(gitHubVersionsRepoInfo.branch)' - --git-path '$(gitHubImageInfoVersionsPath)' - --image-info-orig-path '$(artifactsPath)/eol-annotation-data/image-info-old.json' - --image-info-update-path '$(artifactsPath)/eol-annotation-data/image-info-new.json' + curl -fSL + --output $(imageInfoHostDir)/full-image-info-orig.json + https://raw.githubusercontent.com/$(gitHubVersionsRepoInfo.org)/$(gitHubVersionsRepoInfo.repo)/refs/heads/$(gitHubVersionsRepoInfo.branch)/$(gitHubImageInfoVersionsPath) + condition: and(succeeded(), eq(variables['publishImageInfo'], 'true')) + displayName: Download Latest Image Info + - script: > + $(runImageBuilderCmd) mergeImageInfo + $(imageInfoContainerDir) + $(imageInfoContainerDir)/full-image-info-new.json + $(manifestVariables) $(dryRunArg) - $(imageBuilder.commonCmdArgs) + --manifest $(manifest) + --publish + --initial-image-info-path $(imageInfoContainerDir)/full-image-info-orig.json condition: and(succeeded(), eq(variables['publishImageInfo'], 'true')) - displayName: Publish Image Info + displayName: Merge Image Info - template: /eng/common/templates/steps/run-imagebuilder.yml@self parameters: displayName: Ingest Kusto Image Info @@ -148,8 +149,8 @@ jobs: args: > generateEolAnnotationData '$(artifactsPath)/eol-annotation-data/eol-annotation-data.json' - '$(artifactsPath)/eol-annotation-data/image-info-old.json' - '$(artifactsPath)/eol-annotation-data/image-info-new.json' + '$(imageInfoContainerDir)/full-image-info-orig.json' + '$(imageInfoContainerDir)/full-image-info-new.json' '$(acr.server)' '$(publishRepoPrefix)' $(generateEolAnnotationDataExtraOptions) @@ -166,6 +167,20 @@ jobs: parameters: internalProjectName: ${{ parameters.internalProjectName }} dataFile: $(artifactsPath)/eol-annotation-data/eol-annotation-data.json + - script: > + $(runImageBuilderCmd) publishImageInfo + '$(imageInfoContainerDir)/full-image-info-new.json' + '$(gitHubVersionsRepoInfo.userName)' + '$(gitHubVersionsRepoInfo.email)' + '$(gitHubVersionsRepoInfo.accessToken)' + --git-owner '$(gitHubVersionsRepoInfo.org)' + --git-repo '$(gitHubVersionsRepoInfo.repo)' + --git-branch '$(gitHubVersionsRepoInfo.branch)' + --git-path '$(gitHubImageInfoVersionsPath)' + $(dryRunArg) + $(imageBuilder.commonCmdArgs) + condition: and(succeeded(), eq(variables['publishImageInfo'], 'true')) + displayName: Publish Image Info - script: > $(runImageBuilderCmd) postPublishNotification '$(publishNotificationRepoName)' diff --git a/eng/common/templates/steps/download-build-artifact.yml b/eng/common/templates/steps/download-build-artifact.yml index 3b909d83..ed68ef5b 100644 --- a/eng/common/templates/steps/download-build-artifact.yml +++ b/eng/common/templates/steps/download-build-artifact.yml @@ -2,6 +2,7 @@ parameters: targetPath: "" artifactName: "" condition: true + continueOnError: false steps: - task: DownloadPipelineArtifact@1 @@ -15,3 +16,4 @@ steps: artifactName: ${{ parameters.artifactName }} displayName: Download Build Artifact(s) condition: and(succeeded(), ${{ parameters.condition }}) + continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/templates/variables/docker-images.yml b/eng/common/templates/variables/docker-images.yml index a1f9883b..d74bdc84 100644 --- a/eng/common/templates/variables/docker-images.yml +++ b/eng/common/templates/variables/docker-images.yml @@ -1,5 +1,5 @@ variables: - imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2570468 + imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2584978 imageNames.imageBuilder: $(imageNames.imageBuilderName) imageNames.imageBuilder.withrepo: imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId) imageNames.testRunner: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner2.0-docker-testrunner