[ci] Add OVERRIDE_BUILD_OPTIONS in image build template. (#15309) (#15341)

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
This commit is contained in:
Liu Shilong 2023-06-08 09:42:31 +08:00 committed by GitHub
parent de3b9d24a9
commit d360ec030d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,11 +28,14 @@ jobs:
- template: .azure-pipelines/cleanup.yml@buildimage - template: .azure-pipelines/cleanup.yml@buildimage
- ${{ parameters.preSteps }} - ${{ parameters.preSteps }}
- script: | - script: |
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox)$"; then [ -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)" CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS" BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS"
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
fi fi
echo $BUILD_OPTIONS
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
displayName: "Set cache options" displayName: "Set cache options"
- checkout: self - checkout: self
submodules: recursive submodules: recursive