sonic-buildimage/.azure-pipelines/azure-pipelines-image-template.yml
Shilong Liu dcb9ef3d44
[CI] Update sonic image official build template. (#7198)
* draft

* fix

* Update new-build-template.yml

* Update azure-pipelines-build.yml

* Update azure-pipelines-job-groups.yml

* fix

* fix

* draft

* fix

* fix

* fix

* fix

* fix

* fix

Signed-off-by: Shilong Liu <shilongliu@microsoft.com>

Co-authored-by: Sonic Automation <svc-acs@microsoft.com>
2021-04-08 07:05:31 +08:00

55 lines
1.8 KiB
YAML

# 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
- ${{ parameters. preSteps }}
- script: |
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM) | grep -E -q "^(vs|broadcom|mellanox)$"; then
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM)"
BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS"
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
fi
displayName: "Make build options"
- checkout: self
submodules: recursive
displayName: 'Checkout code'
- script: |
sudo modprobe overlay
sudo apt-get install -y acl
export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM) PLATFORM_ARCH=$(PLATFORM_ARCH) configure
displayName: 'Make configure'
postSteps:
- publish: $(System.DefaultWorkingDirectory)/target
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
displayName: "Archive sonic image"
- ${{ parameters.postSteps }}
- template: cleanup.yml
jobGroups: ${{ parameters.jobGroups }}
buildSteps: ${{ parameters.buildSteps }}