Refactor pipelione to eliminate redundant code

This commit is contained in:
Ella Hathaway 2023-08-22 21:43:26 +00:00
parent c5dac8d360
commit 11e93733df
3 changed files with 72 additions and 41 deletions

View file

@ -51,51 +51,25 @@ jobs:
env:
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
- task: DownloadPipelineArtifact@2
displayName: Download MSFT SDK
inputs:
buildType: specific
buildVersionToDownload: specific
project: internal
pipeline: $(INSTALLER_OFFICIAL_CI_PIPELINE_ID)
buildId: $(InstallerBuildId)
artifact: BlobArtifacts
patterns: '**/dotnet-sdk-+([0-9]).+([0-9]).+([0-9])?(-@(alpha|preview|rc|rtm)*)-linux-${{ parameters.architecture }}.tar.gz'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
downloadPath: $(Pipeline.Workspace)/Artifacts
checkDownloadedFiles: true
- template: ../steps/download-pipeline-artifact.yml
parameters:
patterns: '**/dotnet-sdk-+([0-9]).+([0-9]).+([0-9])?(-@(alpha|preview|rc|rtm)*)-linux-${{ parameters.architecture }}.tar.gz'
displayName: Download MSFT SDK
- task: DownloadPipelineArtifact@2
displayName: Download Source Build SDK
inputs:
buildType: specific
buildVersionToDownload: specific
project: internal
pipeline: $(DOTNET_DOTNET_CI_PIPELINE_ID)
buildId: $(DotnetDotnetBuildId)
artifact: ${{ parameters.buildName }}_${{ parameters.architecture }}_Artifacts
- template: ../steps/download-vmr-artifact.yml
parameters:
buildName: ${{ parameters.buildName }}
architecture: ${{ parameters.architecture }}
patterns: '**/dotnet-sdk-+([0-9]).+([0-9]).+([0-9])?(-@(alpha|preview|rc|rtm)*)-${{ parameters.targetRid }}.tar.gz'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
downloadPath: $(Pipeline.Workspace)/Artifacts
checkDownloadedFiles: true
displayName: Download Source Build SDK
- task: DownloadPipelineArtifact@2
displayName: Download Artifacts
inputs:
buildType: specific
buildVersionToDownload: specific
project: internal
pipeline: $(DOTNET_DOTNET_CI_PIPELINE_ID)
buildId: $(DotnetDotnetBuildId)
artifact: ${{ parameters.buildName }}_${{ parameters.architecture }}_Artifacts
- template: ../steps/download-vmr-artifact.yml
parameters:
buildName: ${{ parameters.buildName }}
architecture: ${{ parameters.architecture }}
patterns: '**/Private.SourceBuilt.Artifacts.+([0-9]).+([0-9]).+([0-9])?(-@(alpha|preview|rc|rtm)*).${{ parameters.targetRid }}.tar.gz'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
downloadPath: $(Pipeline.Workspace)/Artifacts
checkDownloadedFiles: true
displayName: Download Source Built Artifacts
- script: |
msft_sdk_tarball_name=$(find "$(Pipeline.Workspace)/Artifacts" -name "dotnet-sdk-*-linux-${{ parameters.architecture }}.tar.gz" -exec basename {} \;)

View file

@ -0,0 +1,35 @@
parameters:
- name: pipeline
type: string
default: $(INSTALLER_OFFICIAL_CI_PIPELINE_ID)
- name: buildId
type: string
default: $(InstallerBuildId)
- name: artifact
type: string
default: BlobArtifacts
- name: patterns
type: string
- name: displayName
type: string
default: Download Pipeline Artifact
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: specific
buildVersionToDownload: specific
project: internal
pipeline: ${{ parameters.pipeline }}
buildId: ${{ parameters.buildId }}
artifact: ${{ parameters.artifact }}
patterns: ${{ parameters.patterns }}
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
downloadPath: $(Pipeline.Workspace)/Artifacts
checkDownloadedFiles: true
displayName: ${{ parameters.displayName }}

View file

@ -0,0 +1,22 @@
parameters:
- name: buildName
type: string
- name: architecture
type: string
- name: patterns
type: string
- name: displayName
type: string
default: Download VMR Artifact
steps:
- template: ../steps/download-pipeline-artifact.yml
parameters:
pipeline: $(DOTNET_DOTNET_CI_PIPELINE_ID)
buildId: $(DotnetDotnetBuildId)
artifact: ${{ parameters.buildName }}_${{ parameters.architecture }}_Artifacts
patterns: ${{ parameters.patterns }}
displayName: ${{ parameters.displayName }}