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