From 5417aab4ec0f9c2b3fba531ec3200e053432b485 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 25 Oct 2022 16:33:25 +0800 Subject: [PATCH] [202106][ci] Cherry-pick PRs relative to reproducible build option from master branch. (#12350) * [ci] Update azp template variable for reproducible build. (#11419) * [ci] Disable reproducible build in master branch official build (#11452) * [ci] Update reproducible build related pipeline. (#11810) * [ci] Fix bug involved by PR 11810 which affect official build pipeline (#11891) Why I did it Fix the official build not triggered correctly issue, caused by the azp template path not existing. How I did it Change the azp template path. --- .azure-pipelines/azure-pipelines-repd-build-variables.yml | 6 ++++-- .azure-pipelines/official-build.yml | 2 +- azure-pipelines.yml | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-repd-build-variables.yml b/.azure-pipelines/azure-pipelines-repd-build-variables.yml index 7e831109e2..af77e97e2f 100644 --- a/.azure-pipelines/azure-pipelines-repd-build-variables.yml +++ b/.azure-pipelines/azure-pipelines-repd-build-variables.yml @@ -1,5 +1,7 @@ variables: - ${{ if and(ge(variables['Build.SourceBranchName'], '202012'), le(variables['Build.SourceBranchName'], '299999')) }}: + ${{ if eq(variables['Build.Reason'],'PullRequest') }}: + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([[ "$(System.PullRequest.TargetBranch)" =~ ^20[2-9][0-9]{3}$ ]] && echo deb,py2,py3,web,git,docker)' + ${{ elseif ne(variables['Build.SourceBranchName'],'master') }}: VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' - ${{ if or(lt(variables['Build.SourceBranchName'], '202012'), gt(variables['Build.SourceBranchName'], '299999')) }}: + ${{ else }}: VERSION_CONTROL_OPTIONS: '' diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index a4d4a4c798..cb1bf04df3 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -39,7 +39,7 @@ stages: variables: - name: CACHE_MODE value: wcache - - template: azure-pipelines-repd-build-variables.yml + - template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage jobs: - template: azure-pipelines-build.yml parameters: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 07714151ac..3734b11668 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,10 +38,8 @@ resources: ref: master variables: -- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - template: .azure-pipelines/template-variables.yml -- ${{ else }}: - - template: .azure-pipelines/template-variables.yml@buildimage +- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage +- template: .azure-pipelines/template-variables.yml@buildimage stages: - stage: Build