From 25b34551bdf19bbb84555228b093d0c1959df8e9 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Wed, 23 Feb 2022 14:54:02 +0800 Subject: [PATCH] [ci] Use official build debian pkg instead and parameterize source branch (#2079) #### What I did 1. Use official build debian pkg. 2. parameterize download source branch for future release branch. --- azure-pipelines.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 18d088b6efdc..1d795b6bae85 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,14 +29,22 @@ stages: image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest steps: + - script: | + sourceBranch=$(Build.SourceBranchName) + if [[ "$(Build.Reason)" == "PullRequest" ]];then + sourceBranch=$(System.PullRequest.TargetBranch) + fi + echo "Download artifact branch: $sourceBranch" + echo "##vso[task.setvariable variable=sourceBranch]$sourceBranch" + displayName: "Get correct artifact downloading branch" - task: DownloadPipelineArtifact@2 inputs: source: specific project: build - pipeline: 1 + pipeline: 142 artifact: sonic-buildimage.vs runVersion: 'latestFromBranch' - runBranch: 'refs/heads/master' + runBranch: 'refs/heads/$(sourceBranch)' displayName: "Download artifacts from latest sonic-buildimage build" - script: |