-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
192 lines (169 loc) · 4.75 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
trigger:
branches:
include:
- master
- 202???
- 201???
pr:
branches:
include:
- master
- 202???
- 201???
variables:
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.TargetBranch)
${{ else }}:
value: $(Build.SourceBranchName)
- name: CHECKOUT_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.SourceBranch)
${{ else }}:
value: $(Build.SourceBranchName)
parameters:
- name: arch
type: string
values:
- amd64
default: amd64
- name: pool
type: string
values:
- sonicbld
- default
default: default
- name: timeout
type: number
default: 60
- name: sonic_slave
type: string
default: sonic-slave-bookworm
schedules:
- cron: "0 0 * * *"
displayName: Daily
always: true
branches:
include:
- master
jobs:
- job: build
timeoutInMinutes: 240
pool:
vmImage: 'ubuntu-20.04'
container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
steps:
- script: |
sudo apt-get update
sudo apt-get install -qq -y \
libhiredis-dev \
libnl-3-dev \
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
swig
sudo apt-get install -y libsasl2-dev \
libcurl4-openssl-dev \
libssl-dev \
gcc \
g++ \
libboost-dev \
cmake \
zlib1g-dev \
libsasl2-2 \
libzstd-dev
git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF ..
make
sudo make install
cd ../../
sudo apt-get remove -y libcurl4-openssl-dev
git clone https://github.com/edenhill/librdkafka.git
pushd librdkafka
./configure
make
sudo make install
popd
displayName: 'Install openbmp dependencies'
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 142
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
patterns: |
target/debs/bookworm/libyang*.deb
target/debs/bookworm/libnl*.deb
target/python-wheels/bookworm/sonic_yang_models*.whl
displayName: "Download bookworm debs"
- script: |
# LIBSWSSCOMMON
sudo apt-get -y purge libnl-3-dev libnl-route-3-dev
sudo dpkg -i ../target/debs/bookworm/libnl-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-genl-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-route-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-nf-3-200_*.deb
# LIBYANG
sudo dpkg -i ../target/debs/bookworm/libyang*1.0.73*.deb
# SONIC YANGS
set -ex
sudo pip3 install ../target/python-wheels/bookworm/sonic_yang_models-1.0-py3-none-any.whl
displayName: "Install libswsscommon dependencies"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: Azure.sonic-swss-common
artifact: sonic-swss-common-bookworm
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
displayName: "Download sonic-swss-common"
- script: |
set -ex
# LIBSWSSCOMMON
sudo dpkg -i libswsscommon_1.0.0_amd64.deb
sudo dpkg -i libswsscommon-dev_1.0.0_amd64.deb
sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Install libswsscommon package'
- script: |
rm Makefile
ls -alh
git branch
mkdir build
pushd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../
make
popd
displayName: 'Build original openbmp for sanity check'
- script: |
rm -rf build/
mkdir build
pushd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_REDIS=ON ../
make
displayName: 'Build sonic-bmp'
- script: |
set -ex
ls -Rl
cp Server/openbmpd.conf build/Server/openbmpd.conf
rm -rf deb_package/
rm -rf Server/
rm -rf CMakeLists.txt
NO_TEST_BINS=1 dpkg-buildpackage -rfakeroot -b -us -uc
dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc) && cp ../*.deb $(Build.ArtifactStagingDirectory)/
ls -Rl
displayName: "Build Debian Package"
- publish: $(Build.ArtifactStagingDirectory)/
artifact: sonic-bmp
displayName: "Archive sonic-bmp artifacts"