Skip to content

Commit

Permalink
[ci]: use build-template for pr build
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <[email protected]>
  • Loading branch information
lguohan committed Feb 7, 2021
1 parent 54abfd5 commit 092f537
Showing 1 changed file with 13 additions and 60 deletions.
73 changes: 13 additions & 60 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,66 +34,19 @@ stages:
pool: sonicbld

jobs:
- job:
displayName: "broadcom"
timeoutInMinutes: 600
steps:
- script: |
sudo rm -rf fsroot
username=$(id -un)
sudo chown -R ${username}.${username} .
displayName: 'Cleanup'
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'
- script: |
git submodule foreach --recursive git clean -xfdf
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
displayName: 'reset submodules'
- script: |
sudo modprobe overlay
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/broadcom"
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=broadcom
trap "sudo rm -rf fsroot" EXIT
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS target/sonic-broadcom.bin && \
ENABLE_SYNCD_RPC=y make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS target/docker-syncd-brcm-rpc.gz
displayName: 'Build sonic image'
- publish: $(System.DefaultWorkingDirectory)/
artifact: sonic-buildimage.broadcom
displayName: "Archive sonic image"

- job:
displayName: "mellanox"
timeoutInMinutes: 600
steps:
- script: |
sudo rm -rf fsroot
username=$(id -un)
sudo chown -R ${username}.${username} .
displayName: 'Cleanup'
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'

- script: |
git submodule foreach --recursive git clean -xfdf
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
displayName: 'reset submodules'
- script: |
sudo modprobe overlay
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/mellanox"
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=mellanox
trap "sudo rm -rf fsroot" EXIT
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS target/sonic-mellanox.bin && \
ENABLE_SYNCD_RPC=y make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS target/docker-syncd-mlnx-rpc.gz
displayName: 'Build sonic image'
- publish: $(System.DefaultWorkingDirectory)/
artifact: sonic-buildimage.mellanox
displayName: "Archive sonic image"
- template: .azure-pipelines/build-template.yml
parameters:
platform: broadcom
platform_short: brcm
cache_mode: rcache
sync_rpc_image: true

- template: .azure-pipelines/build-template.yml
parameters:
platform: mellanox
platform_short: mlnx
cache_mode: rcache
sync_rpc_image: true

- job:
displayName: "kvm"
Expand Down

0 comments on commit 092f537

Please sign in to comment.