Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions eng/docker-tools/templates/jobs/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ parameters:
# Service connections not in publishConfig.RegistryAuthentication that need OIDC
# token access during publish (e.g., kusto, marStatus). Shape: [{ name: string }]
additionalServiceConnections: []
# When true, the merged image info is published as an OCI artifact to the publish
# registry instead of being committed to the GitHub versions repo. Note that the
# `publishImageInfo` variable must also be set to 'true' for either form of image
# info publishing to run.
useOciArtifactForImageInfo: false

jobs:
- job: Publish
Expand Down Expand Up @@ -217,20 +222,32 @@ jobs:
acr: ${{ parameters.publishConfig.PublishRegistry }}
dataFile: $(artifactsPath)/eol-annotation-data/eol-annotation-data.json

- script: >
$(runImageBuilderCmd) publishImageInfo
'$(imageInfoContainerDir)/full-image-info-new.json'
'$(gitHubVersionsRepoInfo.userName)'
'$(gitHubVersionsRepoInfo.email)'
$(gitHubVersionsRepoInfo.authArgs)
--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
- ${{ if eq(parameters.useOciArtifactForImageInfo, true) }}:
- script: >
$(runAuthedImageBuilderCmd) publishImageInfoArtifact
'$(imageInfoContainerDir)/full-image-info-new.json'
$(dryRunArg)
$(imageBuilder.commonCmdArgs)
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
SYSTEM_OIDCREQUESTURI: $(System.OidcRequestUri)
condition: and(succeeded(), eq(variables['publishImageInfo'], 'true'))
displayName: Publish Image Info
- ${{ else }}:
- script: >
$(runImageBuilderCmd) publishImageInfo
'$(imageInfoContainerDir)/full-image-info-new.json'
'$(gitHubVersionsRepoInfo.userName)'
'$(gitHubVersionsRepoInfo.email)'
$(gitHubVersionsRepoInfo.authArgs)
--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

# Task displayNames names are hardcoded to reference the task prefix used by 1ES official
# pipelines in eng/docker-tools/templates/1es-official.yml.
Expand Down
2 changes: 1 addition & 1 deletion eng/docker-tools/templates/stages/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ stages:
################################################################################
- stage: Post_Build
dependsOn: Build
condition: and(succeededOrFailed(), contains(variables['stages'], 'build'))
condition: and(succeeded(), contains(variables['stages'], 'build'))
jobs:
- template: /eng/docker-tools/templates/jobs/post-build.yml@self
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ parameters:
# Publish parameters
customPublishInitSteps: []

# When true, the merged image info is published as an OCI artifact to the publish
# registry instead of being committed to the GitHub versions repo.
useOciArtifactForImageInfo: false

# Additional service connections not in publishConfig.RegistryAuthentication
# that need OIDC token access (e.g., kusto, marStatus). Shape: [{ name: string }]
additionalServiceConnections: []
Expand Down Expand Up @@ -82,3 +86,4 @@ stages:
additionalServiceConnections: ${{ parameters.additionalServiceConnections }}
sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }}
versionsRepoRef: ${{ parameters.versionsRepoRef }}
useOciArtifactForImageInfo: ${{ parameters.useOciArtifactForImageInfo }}
4 changes: 4 additions & 0 deletions eng/docker-tools/templates/stages/dotnet/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ parameters:
# Service connections not in publishConfig.RegistryAuthentication that need OIDC
# token access during publish (e.g., kusto, marStatus). Shape: [{ name: string }]
additionalServiceConnections: []
# When true, the merged image info is published as an OCI artifact to the publish
# registry instead of being committed to the GitHub versions repo.
useOciArtifactForImageInfo: false

stages:
- template: /eng/docker-tools/templates/stages/publish.yml@self
Expand All @@ -30,6 +33,7 @@ stages:
sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }}
versionsRepoRef: ${{ parameters.versionsRepoRef }}
overrideImageInfoCommit: ${{ parameters.overrideImageInfoCommit }}
useOciArtifactForImageInfo: ${{ parameters.useOciArtifactForImageInfo }}

customPublishInitSteps:
- pwsh: |
Expand Down
5 changes: 5 additions & 0 deletions eng/docker-tools/templates/stages/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ parameters:
# token access during publish (e.g., kusto, marStatus). Shape: [{ name: string }]
additionalServiceConnections: []

# When true, the merged image info is published as an OCI artifact to the publish
# registry instead of being committed to the GitHub versions repo.
useOciArtifactForImageInfo: false

################################################################################
# Publish Images
################################################################################
Expand Down Expand Up @@ -86,3 +90,4 @@ stages:
versionsRepoPath: ${{ parameters.versionsRepoPath }}
overrideImageInfoCommit: ${{ parameters.overrideImageInfoCommit }}
additionalServiceConnections: ${{ parameters.additionalServiceConnections }}
useOciArtifactForImageInfo: ${{ parameters.useOciArtifactForImageInfo }}
Loading