-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci]: Add yaml for azure pipeline official build (#6588)
**- Why I did it** To support nightly build for master branch **- How to verify it** confirm from azure pipeline page.
- Loading branch information
1 parent
18f2c5c
commit 23381e6
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
parameters: | ||
- name: platform | ||
type: string | ||
values: | ||
- broadcom | ||
- mellanox | ||
|
||
- name: platform_short | ||
type: string | ||
values: | ||
- brcm | ||
- mlnx | ||
|
||
- name: cache_mode | ||
type: string | ||
values: | ||
- wcache | ||
- rcache | ||
- cache | ||
|
||
- name: dbg_image | ||
type: boolean | ||
|
||
- name: swi_image | ||
type: boolean | ||
|
||
- name: raw_image | ||
type: boolean | ||
|
||
- name: sync_rpc_image | ||
type: boolean | ||
|
||
jobs: | ||
- job: | ||
displayName: ${{ parameters.platform }} | ||
timeoutInMinutes: 600 | ||
steps: | ||
- checkout: self | ||
submodules: recursive | ||
displayName: 'Checkout code' | ||
- template: cleanup.yml | ||
- script: | | ||
set -e | ||
sudo modprobe overlay | ||
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=${{ parameters.cache_mode }} SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/${{ parameters.platform }}" | ||
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} | ||
trap "sudo rm -rf fsroot" EXIT | ||
if [ ${{ parameters.dbg_image }} ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \ | ||
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin | ||
fi | ||
if [ ${{ parameters.swi_image }} ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi | ||
fi | ||
if [ ${{ parameters.raw_image }} ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw | ||
fi | ||
if [ ${{ parameters.sync_rpc_image }} ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz | ||
fi | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin | ||
displayName: 'Build sonic image' | ||
- publish: $(System.DefaultWorkingDirectory)/ | ||
artifact: sonic-buildimage.${{ parameters.platform }} | ||
displayName: "Archive sonic image" | ||
- template: cleanup.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
steps: | ||
- script: | | ||
sudo kill -9 `sudo cat /var/run/march/docker.pid` || true | ||
sudo rm -f /var/run/march/docker.pid || true | ||
sudo rm -rf fsroot || true | ||
git clean -xfdf || true | ||
git reset --hard || true | ||
git submodule foreach --recursive 'git clean -xfdf || true' || true | ||
git submodule foreach --recursive 'git reset --hard || true' || true | ||
git submodule foreach --recursive 'git remote update || true' || true | ||
git submodule update --init --recursive || true | ||
displayName: "Clean Workspace" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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 | ||
|
||
schedules: | ||
- cron: "0 8 * * *" | ||
displayName: Daily midnight build | ||
branches: | ||
include: | ||
- master | ||
always: true | ||
|
||
stages: | ||
- stage: Build | ||
pool: sonicbld | ||
|
||
jobs: | ||
- template: build-template.yml | ||
parameters: | ||
platform: broadcom | ||
platform_short: brcm | ||
cache_mode: wcache | ||
dbg_image: true | ||
swi_image: true | ||
raw_image: true | ||
sync_rpc_image: true |