From e1291514db2b09d237a5e62a39e79e33fd6094c5 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Thu, 8 Jun 2023 09:42:45 +0800 Subject: [PATCH] [ci] Add OVERRIDE_BUILD_OPTIONS in image build template. (#15309) (#15340) Why I did it Set build options in pipeline UI. Support setting reproducible build options to py2,py3 in release branch and none in master branch. Work item tracking Microsoft ADO (number only): 22335854 How I did it How to verify it --- .azure-pipelines/azure-pipelines-image-template.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 13bef03c9e..dad5c0edee 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -28,11 +28,14 @@ jobs: - template: .azure-pipelines/cleanup.yml@buildimage - ${{ parameters.preSteps }} - script: | + [ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS) + BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS" if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)" - BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS" - echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" + BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS" fi + echo $BUILD_OPTIONS + echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" displayName: "Set cache options" - checkout: self submodules: recursive