2021-04-21 21:11:11 -05:00
|
|
|
# The azure pipeline template for PR build, Official build, and upgrade version build
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
- name: 'jobFilters'
|
|
|
|
type: object
|
|
|
|
default: ''
|
|
|
|
- name: 'preSteps'
|
|
|
|
type: stepList
|
|
|
|
default: []
|
|
|
|
- name: 'buildSteps'
|
|
|
|
type: stepList
|
|
|
|
default: []
|
|
|
|
- name: 'postSteps'
|
|
|
|
type: stepList
|
|
|
|
default: []
|
|
|
|
- name: jobGroups
|
|
|
|
type: object
|
|
|
|
default: []
|
|
|
|
- name: jobVariables
|
|
|
|
type: object
|
|
|
|
default: []
|
|
|
|
jobs:
|
|
|
|
- template: azure-pipelines-job-groups.yml
|
|
|
|
parameters:
|
|
|
|
jobFilters: ${{ parameters.jobFilters }}
|
|
|
|
jobVariables: ${{ parameters.jobVariables }}
|
|
|
|
preSteps:
|
|
|
|
- template: cleanup.yml
|
2021-10-08 02:31:49 -05:00
|
|
|
- ${{ parameters.preSteps }}
|
2021-04-21 21:11:11 -05:00
|
|
|
- script: |
|
2021-12-03 19:31:53 -06:00
|
|
|
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then
|
2021-04-21 21:11:11 -05:00
|
|
|
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"
|
|
|
|
fi
|
|
|
|
displayName: "Set cache options"
|
|
|
|
- checkout: self
|
|
|
|
submodules: recursive
|
2021-10-08 02:31:49 -05:00
|
|
|
condition: eq(variables.SKIP_CHECKOUT, '')
|
2021-04-21 21:11:11 -05:00
|
|
|
displayName: 'Checkout code'
|
|
|
|
- script: |
|
2021-04-22 21:24:00 -05:00
|
|
|
BRANCH_NAME=$(Build.SourceBranchName)
|
|
|
|
[ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
|
|
|
|
git checkout -b $BRANCH_NAME
|
2021-04-21 21:11:11 -05:00
|
|
|
sudo modprobe overlay
|
|
|
|
sudo apt-get install -y acl
|
|
|
|
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
|
2021-07-09 01:51:17 -05:00
|
|
|
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
|
2021-04-21 21:11:11 -05:00
|
|
|
displayName: 'Make configure'
|
|
|
|
postSteps:
|
|
|
|
- script: cp target -r $(Build.ArtifactStagingDirectory)/
|
|
|
|
displayName: Copy Artifacts
|
|
|
|
- publish: $(Build.ArtifactStagingDirectory)
|
|
|
|
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
|
|
|
|
displayName: "Archive sonic image"
|
|
|
|
- ${{ parameters.postSteps }}
|
|
|
|
- template: cleanup.yml
|
|
|
|
jobGroups: ${{ parameters.jobGroups }}
|
|
|
|
buildSteps: ${{ parameters.buildSteps }}
|