Skip to content

Commit

Permalink
[ci]: build amd64/armhf/arm64 for CI build (sonic-net#196)
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan authored Feb 10, 2021
1 parent fc74b1c commit 7c57fef
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 17 deletions.
48 changes: 48 additions & 0 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
parameters:
- name: arch
type: string
values:
- amd64
- armhf
- arm64

- name: pool
type: string
values:
- sonicbld
- sonicbld_8c
default: sonicbld

- name: timeout
type: number
default: 600

- name: sonic_slave
type: string

- name: artifact_name
type: string

jobs:
- job:
pool: ${{ parameters.pool }}
displayName: ${{ parameters.arch }}
timeoutInMinutes: ${{ parameters.timeout }}

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest

steps:
- checkout: self
clean: true
displayName: 'Checkout code'
- script: |
git config --global user.email "lguohan@build.com"
git config --global user.name "Guohan Lu"
export kernel_procure_method=build
cat /proc/cpuinfo
CONFIGURED_ARCH=${{ parameters.arch }} make
displayName: "Compile sonic kernel"
- publish: $(System.DefaultWorkingDirectory)/
artifact: ${{ parameters.artifact_name }}
displayName: "Archive sonic kernel debian packages"
42 changes: 25 additions & 17 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,30 @@ trigger:
branches:
include:
- "*"
jobs:
- job:
timeoutInMinutes: 240
pool: sonicbld

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest
stages:
- stage: Build

steps:
- script: |
git config --global user.email "lguohan@build.com"
git config --global user.name "Guohan Lu"
export kernel_procure_method=build
cat /proc/cpuinfo
make
displayName: "Compile sonic kernel"
- publish: $(System.DefaultWorkingDirectory)/
artifact: sonic-linux-kernel
displayName: "Archive sonic kernel debian packages"
jobs:
- template: .azure-pipelines/build-template.yml
parameters:
arch: amd64
sonic_slave: sonic-slave-buster
artifact_name: sonic-linux-kernel

- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: .azure-pipelines/build-template.yml
parameters:
arch: armhf
timeout: 1440
pool: sonicbld_8c
sonic_slave: sonic-slave-buster-armhf
artifact_name: sonic-linux-kernel.armhf

- template: .azure-pipelines/build-template.yml
parameters:
arch: arm64
timeout: 1440
pool: sonicbld_8c
sonic_slave: sonic-slave-buster-arm64
artifact_name: sonic-linux-kernel.arm64

0 comments on commit 7c57fef

Please sign in to comment.