Refactor pipelione to eliminate redundant code
This commit is contained in:
parent
c5dac8d360
commit
11e93733df
3 changed files with 72 additions and 41 deletions
|
@ -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 {} \;)
|
||||
|
||||
|
|
35
eng/pipelines/templates/steps/download-pipeline-artifact.yml
Normal file
35
eng/pipelines/templates/steps/download-pipeline-artifact.yml
Normal 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 }}
|
22
eng/pipelines/templates/steps/download-vmr-artifact.yml
Normal file
22
eng/pipelines/templates/steps/download-vmr-artifact.yml
Normal 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 }}
|
Loading…
Add table
Reference in a new issue