2021-01-20 03:06:40 -06:00
|
|
|
# Starter pipeline
|
|
|
|
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
|
|
|
# Add steps that build, run tests, deploy, and more:
|
|
|
|
# https://aka.ms/yaml
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
- main
|
|
|
|
|
|
|
|
name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
|
|
|
|
|
|
|
resources:
|
|
|
|
repositories:
|
|
|
|
- repository: sonic-mgmt
|
|
|
|
type: github
|
|
|
|
name: Azure/sonic-mgmt
|
|
|
|
endpoint: build
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- stage: Build
|
|
|
|
pool: sonicbld
|
2021-04-19 20:15:00 -05:00
|
|
|
variables:
|
|
|
|
CACHE_MODE: rcache
|
|
|
|
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
|
|
|
|
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
|
|
|
|
jobs:
|
|
|
|
- template: .azure-pipelines/azure-pipelines-build.yml
|
|
|
|
parameters:
|
|
|
|
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
|
|
|
|
jobFilters:
|
|
|
|
- vs
|
|
|
|
- broadcom
|
|
|
|
- mellanox
|
|
|
|
|
|
|
|
- stage: Test
|
|
|
|
variables:
|
|
|
|
- name: inventory
|
|
|
|
value: veos_vtb
|
|
|
|
- name: testbed_file
|
|
|
|
value: vtestbed.csv
|
2021-01-20 03:06:40 -06:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job:
|
|
|
|
displayName: "broadcom"
|
|
|
|
timeoutInMinutes: 600
|
|
|
|
steps:
|
2021-02-03 09:27:51 -06:00
|
|
|
- script: |
|
2021-02-17 18:30:05 -06:00
|
|
|
set -x
|
2021-02-03 09:27:51 -06:00
|
|
|
sudo rm -rf fsroot
|
2021-02-03 12:32:27 -06:00
|
|
|
username=$(id -un)
|
2021-02-17 18:30:05 -06:00
|
|
|
sudo chown -cR ${username}.${username} .
|
2021-02-03 09:27:51 -06:00
|
|
|
displayName: 'Cleanup'
|
2021-01-20 03:06:40 -06:00
|
|
|
- checkout: self
|
2021-01-30 16:19:41 -06:00
|
|
|
clean: true
|
2021-01-20 03:06:40 -06:00
|
|
|
submodules: recursive
|
|
|
|
displayName: 'Checkout code'
|
2021-01-29 10:53:57 -06:00
|
|
|
- script: |
|
|
|
|
git submodule foreach --recursive git clean -xfdf
|
|
|
|
git submodule foreach --recursive git reset --hard
|
|
|
|
git submodule update --init --recursive
|
|
|
|
displayName: 'reset submodules'
|
2021-01-20 03:06:40 -06:00
|
|
|
- script: |
|
|
|
|
sudo modprobe overlay
|
|
|
|
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/broadcom"
|
|
|
|
make configure PLATFORM=broadcom
|
|
|
|
trap "sudo rm -rf fsroot" EXIT
|
|
|
|
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS target/sonic-broadcom.bin
|
|
|
|
displayName: 'Build sonic image'
|
|
|
|
- publish: $(System.DefaultWorkingDirectory)/
|
|
|
|
artifact: sonic-buildimage.broadcom.201911
|
|
|
|
displayName: "Archive sonic image"
|
|
|
|
|
|
|
|
- job:
|
|
|
|
displayName: "mellanox"
|
|
|
|
timeoutInMinutes: 600
|
|
|
|
steps:
|
2021-02-03 09:27:51 -06:00
|
|
|
- script: |
|
2021-02-17 18:30:05 -06:00
|
|
|
set -x
|
2021-02-03 09:27:51 -06:00
|
|
|
sudo rm -rf fsroot
|
2021-02-03 12:32:27 -06:00
|
|
|
username=$(id -un)
|
2021-02-17 18:30:05 -06:00
|
|
|
sudo chown -cR ${username}.${username} .
|
2021-02-03 09:27:51 -06:00
|
|
|
displayName: 'Cleanup'
|
2021-01-20 03:06:40 -06:00
|
|
|
- checkout: self
|
2021-01-30 16:19:41 -06:00
|
|
|
clean: true
|
2021-01-20 03:06:40 -06:00
|
|
|
submodules: recursive
|
|
|
|
displayName: 'Checkout code'
|
|
|
|
|
2021-01-29 10:53:57 -06:00
|
|
|
- script: |
|
|
|
|
git submodule foreach --recursive git clean -xfdf
|
|
|
|
git submodule foreach --recursive git reset --hard
|
|
|
|
git submodule update --init --recursive
|
|
|
|
displayName: 'reset submodules'
|
2021-01-20 03:06:40 -06:00
|
|
|
- script: |
|
|
|
|
sudo modprobe overlay
|
|
|
|
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/mellanox"
|
|
|
|
make configure PLATFORM=mellanox
|
|
|
|
trap "sudo rm -rf fsroot" EXIT
|
|
|
|
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS target/sonic-mellanox.bin
|
|
|
|
displayName: 'Build sonic image'
|
|
|
|
- publish: $(System.DefaultWorkingDirectory)/
|
|
|
|
artifact: sonic-buildimage.mellanox.201911
|
|
|
|
displayName: "Archive sonic image"
|
|
|
|
|
|
|
|
- job:
|
|
|
|
displayName: "kvm"
|
|
|
|
timeoutInMinutes: 600
|
|
|
|
steps:
|
2021-02-03 09:27:51 -06:00
|
|
|
- script: |
|
2021-02-17 18:30:05 -06:00
|
|
|
set -x
|
2021-02-03 09:27:51 -06:00
|
|
|
sudo rm -rf fsroot
|
2021-02-03 12:32:27 -06:00
|
|
|
username=$(id -un)
|
2021-02-17 18:30:05 -06:00
|
|
|
sudo chown -cR ${username}.${username} .
|
2021-02-03 09:27:51 -06:00
|
|
|
displayName: 'Cleanup'
|
2021-01-20 03:06:40 -06:00
|
|
|
- checkout: self
|
2021-01-30 16:19:41 -06:00
|
|
|
clean: true
|
2021-01-20 03:06:40 -06:00
|
|
|
submodules: recursive
|
|
|
|
displayName: 'Checkout code'
|
|
|
|
|
2021-01-29 10:53:57 -06:00
|
|
|
- script: |
|
|
|
|
git submodule foreach --recursive git clean -xfdf
|
|
|
|
git submodule foreach --recursive git reset --hard
|
|
|
|
git submodule update --init --recursive
|
|
|
|
displayName: 'reset submodules'
|
2021-01-20 03:06:40 -06:00
|
|
|
- script: |
|
|
|
|
echo $(Build.BuildNumber)
|
|
|
|
sudo modprobe overlay
|
|
|
|
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/vs"
|
|
|
|
make configure PLATFORM=vs
|
|
|
|
trap "sudo rm -rf fsroot" EXIT
|
|
|
|
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS \
|
|
|
|
target/docker-sonic-vs.gz target/sonic-vs.img.gz && \
|
|
|
|
sudo cp target/sonic-vs.img.gz /nfs/azpl/kvmimage/sonic-vs.$(Build.BuildNumber).img.gz
|
|
|
|
displayName: 'Build sonic image'
|
|
|
|
- publish: $(System.DefaultWorkingDirectory)/
|
|
|
|
artifact: sonic-buildimage.kvm.201911
|
|
|
|
displayName: "Archive sonic image"
|