Skip to content

Commit 1d9f197

Browse files
committed
multiple artifacts
1 parent 6a77e4b commit 1d9f197

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

.azure-pipelines/generation-templates/capture-openapi.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
matrix: $[ dependencies.get_conversion_settings.outputs['setTargets.targets'] ]
4343
variables:
4444
targets: $[ dependencies.get_conversion_settings.outputs['setTargets.targets'] ]
45+
templateContext:
46+
outputs:
47+
- output: pipelineArtifact
48+
targetPath: '$(Build.ArtifactStagingDirectory)'
49+
artifactName: '${{ parameters.cleanMetadataFolder }}-$(Name)'
4550
steps:
4651
- checkout: self
4752
displayName: checkout generator
@@ -73,6 +78,13 @@ jobs:
7378
displayName: 'update ${{ parameters.endpoint }} open API description'
7479
workingDirectory: $(Build.SourcesDirectory)/msgraph-metadata
7580

81+
# publish metadata as an artifact
82+
- task: CopyFiles@2
83+
inputs:
84+
sourceFolder: ${{ parameters.outputPath }}
85+
contents: '**/$(Name).yaml'
86+
targetFolder: '$(Build.ArtifactStagingDirectory)'
87+
displayName: Copy generated metadata
7688
- pwsh: |
7789
./scripts/run-openapi-validation.ps1 -repoDirectory (Get-Location).Path -version "${{ parameters.endpoint }}" -platformName "$(Name)"
7890
displayName: ensure that OpenAPI docs can be parsed
@@ -83,23 +95,28 @@ jobs:
8395
dependsOn: convert_openapi
8496
displayName: Publish
8597
templateContext:
98+
inputs:
99+
# Download all artifacts from matrix jobs
100+
- input: pipelineArtifact
101+
patterns: '${{ parameters.cleanMetadataFolder }}-*'
102+
targetPath: '$(Build.SourcesDirectory)/msgraph-metadata/openapi/${{ parameters.endpoint }}'
86103
outputs:
87104
- output: pipelineArtifact
88105
targetPath: '$(Build.ArtifactStagingDirectory)'
89106
artifactName: ${{ parameters.cleanMetadataFolder }}
90107
steps:
91-
# publish metadata as an artifact
92-
- task: CopyFiles@2
93-
inputs:
94-
sourceFolder: ${{ parameters.outputPath }}
95-
contents: '**/*.yaml'
96-
targetFolder: '$(Build.ArtifactStagingDirectory)'
97-
displayName: Copy generated metadata
98108
# We only need the scripts
99109
- checkout: self
100110
displayName: checkout generator
101111
fetchDepth: 1
102112
persistCredentials: true
113+
# publish metadata as an artifact
114+
- task: CopyFiles@2
115+
inputs:
116+
sourceFolder: ${{ parameters.outputPath }}
117+
contents: '**/*.yaml'
118+
targetFolder: '$(Build.ArtifactStagingDirectory)'
119+
displayName: Copy downloaded metadata
103120
- template: /.azure-pipelines/generation-templates/checkout-metadata.yml@self
104121
- template: /.azure-pipelines/generation-templates/set-user-config.yml@self
105122
- pwsh: '$(scriptsDirectory)/git-push-cleanmetadata.ps1'

0 commit comments

Comments
 (0)