-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathazure-pipelines.yml
98 lines (91 loc) · 2.85 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# 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
pr:
- main
trigger:
batch: true
branches:
include:
- main
pool:
vmImage: ubuntu-20.04
schedules:
- cron: "0 8 * * *"
displayName: Daily midnight build
branches:
include:
- main
always: true
parameters:
- name: debian_version
type: string
default: bookworm
- name: arch
type: string
default: amd64
variables:
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.TargetBranch)
${{ else }}:
value: $(Build.SourceBranchName)
- name: SONIC_BRANCH
${{ if eq(variables['BUILD_BRANCH'], 'main') }}:
value: master
${{ else }}:
value: $(BUILD_BRANCH)
stages:
- stage: BuildVpp
jobs:
- job:
displayName: amd64
timeoutInMinutes: 300
container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-${{ parameters.debian_version }}:latest
options: "--privileged"
steps:
- checkout: self
clean: true
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib
patterns: |
target/debs/${{ parameters.debian_version }}/libnl-3*.deb
target/debs/${{ parameters.debian_version }}/libnl-genl*.deb
target/debs/${{ parameters.debian_version }}/libnl-route*.deb
target/debs/${{ parameters.debian_version }}/libnl-nf*.deb
displayName: "Download common libs"
- script: |
set -ex
echo "SONIC_BRANCH: $(SONIC_BRANCH), BUILD_BRANCH: $(BUILD_BRANCH)"
# install libyang before install libswsscommon
sudo dpkg -i $(find ./download -name *.deb)
rm -rf download || true
cat /etc/apt/sources.list
dpkg --list |grep libnl
workingDirectory: $(Build.ArtifactStagingDirectory)
displayName: "Install libnl3"
- script: |
set -ex
git clone https://github.com/sonic-net/sonic-platform-vpp.git
mkdir repo
git clone https://gerrit.fd.io/r/vpp repo
cp -vr sonic-platform-vpp/vppbld/plugins/* repo/src/packages
cd repo
git apply ../sonic-platform-vpp/vppbld/vpp.patch
make UNATTENDED=y PLATFORM=vpp install-deps install-ext-deps
make UNATTENDED=y PLATFORM=vpp -j4 pkg-deb
mkdir artifacts
mv build-root/*.deb artifacts/
displayName: "Build VPP packages from source"
- publish: $(System.DefaultWorkingDirectory)/repo/artifacts
artifact: vpp
displayName: "Archive vpp debian packages"