Skip to content

Commit 18c79ff

Browse files
lguohanroot
authored andcommitted
[ci]: use build template (sonic-net#1633)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
1 parent 8cc13c1 commit 18c79ff

File tree

2 files changed

+131
-192
lines changed

2 files changed

+131
-192
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
parameters:
2+
- name: arch
3+
type: string
4+
values:
5+
- amd64
6+
- armhf
7+
- arm64
8+
9+
- name: pool
10+
type: string
11+
values:
12+
- sonicbld
13+
- default
14+
default: default
15+
16+
- name: timeout
17+
type: number
18+
default: 60
19+
20+
- name: sonic_slave
21+
type: string
22+
23+
- name: sairedis_artifact_name
24+
type: string
25+
26+
- name: swss_common_artifact_name
27+
type: string
28+
29+
- name: artifact_name
30+
type: string
31+
32+
jobs:
33+
- job:
34+
displayName: ${{ parameters.arch }}
35+
timeoutInMinutes: ${{ parameters.timeout }}
36+
37+
pool:
38+
${{ if ne(parameters.pool, 'default') }}:
39+
name: ${{ parameters.pool }}
40+
${{ if eq(parameters.pool, 'default') }}:
41+
vmImage: 'ubuntu-20.04'
42+
43+
container:
44+
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
45+
46+
steps:
47+
- script: |
48+
sudo apt-get install -y libhiredis0.14 libhiredis-dev
49+
sudo apt-get install -y libzmq5 libzmq3-dev
50+
sudo apt-get install -qq -y \
51+
libhiredis-dev \
52+
libnl-3-dev \
53+
libnl-genl-3-dev \
54+
libnl-route-3-dev \
55+
libnl-nf-3-dev \
56+
swig3.0
57+
sudo apt-get install -y libdbus-1-3
58+
sudo apt-get install -y libteam-dev \
59+
libteam5 \
60+
libteamdctl0
61+
displayName: "Install dependencies"
62+
- task: DownloadPipelineArtifact@2
63+
inputs:
64+
source: specific
65+
project: build
66+
pipeline: 9
67+
artifacts: ${{ parameters.swss_common_artifact_name }}
68+
runVersion: 'latestFromBranch'
69+
runBranch: 'refs/heads/master'
70+
displayName: "Download sonic swss common deb packages"
71+
- task: DownloadPipelineArtifact@2
72+
inputs:
73+
source: specific
74+
project: build
75+
pipeline: 12
76+
artifacts: ${{ parameters.sairedis_artifact_name }}
77+
runVersion: 'latestFromBranch'
78+
runBranch: 'refs/heads/master'
79+
displayName: "Download sonic sairedis deb packages"
80+
- script: |
81+
sudo dpkg -i ${{ parameters.swss_common_artifact_name }}/libswsscommon_1.0.0_${{ parameters.arch }}.deb
82+
sudo dpkg -i ${{ parameters.swss_common_artifact_name }}/libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
83+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/libsaivs_*.deb
84+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/libsaivs-dev_*.deb
85+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/libsairedis_*.deb
86+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/libsairedis-dev_*.deb
87+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/libsaimetadata_*.deb
88+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/libsaimetadata-dev_*.deb
89+
sudo dpkg -i ${{ parameters.sairedis_artifact_name }}/syncd-vs_*.deb
90+
workingDirectory: $(Pipeline.Workspace)
91+
displayName: "Install sonic swss common and sairedis"
92+
- checkout: self
93+
submodules: true
94+
- script: |
95+
./autogen.sh
96+
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
97+
displayName: "Compile sonic swss"
98+
- publish: $(System.DefaultWorkingDirectory)/
99+
artifact: ${{ parameters.artifact_name }}
100+
displayName: "Archive swss debian packages"

azure-pipelines.yml

Lines changed: 31 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -8,195 +8,34 @@ trigger:
88
include:
99
- "*"
1010

11-
jobs:
12-
- job:
13-
displayName: "amd64"
14-
pool:
15-
vmImage: 'ubuntu-20.04'
16-
17-
container:
18-
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest
19-
20-
steps:
21-
- script: |
22-
sudo apt-get install -y libhiredis0.14 libhiredis-dev
23-
sudo apt-get install -y libzmq5 libzmq3-dev
24-
sudo apt-get install -qq -y \
25-
libhiredis-dev \
26-
libnl-3-dev \
27-
libnl-genl-3-dev \
28-
libnl-route-3-dev \
29-
libnl-nf-3-dev \
30-
swig3.0
31-
sudo apt-get install -y libdbus-1-3
32-
sudo apt-get install -y libteam-dev \
33-
libteam5 \
34-
libteamdctl0
35-
displayName: "Install dependencies"
36-
- task: DownloadPipelineArtifact@2
37-
inputs:
38-
source: specific
39-
project: build
40-
pipeline: 9
41-
artifacts: sonic-swss-common
42-
runVersion: 'latestFromBranch'
43-
runBranch: 'refs/heads/master'
44-
displayName: "Download sonic swss common deb packages"
45-
- task: DownloadPipelineArtifact@2
46-
inputs:
47-
source: specific
48-
project: build
49-
pipeline: 12
50-
artifacts: sonic-sairedis
51-
runVersion: 'latestFromBranch'
52-
runBranch: 'refs/heads/master'
53-
displayName: "Download sonic sairedis deb packages"
54-
- script: |
55-
sudo dpkg -i sonic-swss-common/libswsscommon_1.0.0_amd64.deb
56-
sudo dpkg -i sonic-swss-common/libswsscommon-dev_1.0.0_amd64.deb
57-
sudo dpkg -i sonic-sairedis/libsaivs_*.deb
58-
sudo dpkg -i sonic-sairedis/libsaivs-dev_*.deb
59-
sudo dpkg -i sonic-sairedis/libsairedis_*.deb
60-
sudo dpkg -i sonic-sairedis/libsairedis-dev_*.deb
61-
sudo dpkg -i sonic-sairedis/libsaimetadata_*.deb
62-
sudo dpkg -i sonic-sairedis/libsaimetadata-dev_*.deb
63-
sudo dpkg -i sonic-sairedis/syncd-vs_*.deb
64-
workingDirectory: $(Pipeline.Workspace)
65-
displayName: "Install sonic swss common and sairedis"
66-
- checkout: self
67-
submodules: true
68-
- script: |
69-
./autogen.sh
70-
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
71-
displayName: "Compile sonic swss"
72-
- publish: $(System.DefaultWorkingDirectory)/
73-
artifact: sonic-swss
74-
displayName: "Archive swss debian packages"
75-
76-
- job:
77-
displayName: "arm64"
78-
timeoutInMinutes: 180
79-
pool: sonicbld
80-
81-
container:
82-
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-arm64:latest
83-
84-
steps:
85-
- script: |
86-
sudo apt-get install -y libhiredis0.14 libhiredis-dev
87-
sudo apt-get install -y libzmq5 libzmq3-dev
88-
sudo apt-get install -qq -y \
89-
libhiredis-dev \
90-
libnl-3-dev \
91-
libnl-genl-3-dev \
92-
libnl-route-3-dev \
93-
libnl-nf-3-dev \
94-
swig3.0
95-
sudo apt-get install -y libdbus-1-3
96-
sudo apt-get install -y libteam-dev \
97-
libteam5 \
98-
libteamdctl0
99-
displayName: "Install dependencies"
100-
- task: DownloadPipelineArtifact@2
101-
inputs:
102-
source: specific
103-
project: build
104-
pipeline: 9
105-
artifacts: sonic-swss-common.arm64
106-
runVersion: 'latestFromBranch'
107-
runBranch: 'refs/heads/master'
108-
displayName: "Download sonic swss common deb packages"
109-
- task: DownloadPipelineArtifact@2
110-
inputs:
111-
source: specific
112-
project: build
113-
pipeline: 12
114-
artifacts: sonic-sairedis.arm64
115-
runVersion: 'latestFromBranch'
116-
runBranch: 'refs/heads/master'
117-
displayName: "Download sonic sairedis deb packages"
118-
- script: |
119-
sudo dpkg -i sonic-swss-common.arm64/libswsscommon_1.0.0_arm64.deb
120-
sudo dpkg -i sonic-swss-common.arm64/libswsscommon-dev_1.0.0_arm64.deb
121-
sudo dpkg -i sonic-sairedis.arm64/libsaivs_*.deb
122-
sudo dpkg -i sonic-sairedis.arm64/libsaivs-dev_*.deb
123-
sudo dpkg -i sonic-sairedis.arm64/libsairedis_*.deb
124-
sudo dpkg -i sonic-sairedis.arm64/libsairedis-dev_*.deb
125-
sudo dpkg -i sonic-sairedis.arm64/libsaimetadata_*.deb
126-
sudo dpkg -i sonic-sairedis.arm64/libsaimetadata-dev_*.deb
127-
sudo dpkg -i sonic-sairedis.arm64/syncd-vs_*.deb
128-
workingDirectory: $(Pipeline.Workspace)
129-
displayName: "Install sonic swss common and sairedis"
130-
- checkout: self
131-
submodules: true
132-
- script: |
133-
./autogen.sh
134-
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
135-
displayName: "Compile sonic swss"
136-
- publish: $(System.DefaultWorkingDirectory)/
137-
artifact: sonic-swss.arm64
138-
displayName: "Archive swss debian packages"
139-
140-
- job:
141-
displayName: "armhf"
142-
timeoutInMinutes: 180
143-
pool: sonicbld
144-
145-
container:
146-
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-armhf:latest
147-
148-
steps:
149-
- script: |
150-
sudo apt-get install -y libhiredis0.14 libhiredis-dev
151-
sudo apt-get install -y libzmq5 libzmq3-dev
152-
sudo apt-get install -qq -y \
153-
libhiredis-dev \
154-
libnl-3-dev \
155-
libnl-genl-3-dev \
156-
libnl-route-3-dev \
157-
libnl-nf-3-dev \
158-
swig3.0
159-
sudo apt-get install -y libdbus-1-3
160-
sudo apt-get install -y libteam-dev \
161-
libteam5 \
162-
libteamdctl0
163-
displayName: "Install dependencies"
164-
- task: DownloadPipelineArtifact@2
165-
inputs:
166-
source: specific
167-
project: build
168-
pipeline: 9
169-
artifacts: sonic-swss-common.armhf
170-
runVersion: 'latestFromBranch'
171-
runBranch: 'refs/heads/master'
172-
displayName: "Download sonic swss common deb packages"
173-
- task: DownloadPipelineArtifact@2
174-
inputs:
175-
source: specific
176-
project: build
177-
pipeline: 12
178-
artifacts: sonic-sairedis.armhf
179-
runVersion: 'latestFromBranch'
180-
runBranch: 'refs/heads/master'
181-
displayName: "Download sonic sairedis deb packages"
182-
- script: |
183-
sudo dpkg -i sonic-swss-common.armhf/libswsscommon_1.0.0_armhf.deb
184-
sudo dpkg -i sonic-swss-common.armhf/libswsscommon-dev_1.0.0_armhf.deb
185-
sudo dpkg -i sonic-sairedis.armhf/libsaivs_*.deb
186-
sudo dpkg -i sonic-sairedis.armhf/libsaivs-dev_*.deb
187-
sudo dpkg -i sonic-sairedis.armhf/libsairedis_*.deb
188-
sudo dpkg -i sonic-sairedis.armhf/libsairedis-dev_*.deb
189-
sudo dpkg -i sonic-sairedis.armhf/libsaimetadata_*.deb
190-
sudo dpkg -i sonic-sairedis.armhf/libsaimetadata-dev_*.deb
191-
sudo dpkg -i sonic-sairedis.armhf/syncd-vs_*.deb
192-
workingDirectory: $(Pipeline.Workspace)
193-
displayName: "Install sonic swss common and sairedis"
194-
- checkout: self
195-
submodules: true
196-
- script: |
197-
./autogen.sh
198-
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
199-
displayName: "Compile sonic swss"
200-
- publish: $(System.DefaultWorkingDirectory)/
201-
artifact: sonic-swss.armhf
202-
displayName: "Archive swss debian packages"
11+
stages:
12+
- stage: Build
13+
14+
jobs:
15+
- template: .azure-pipelines/build-template.yml
16+
parameters:
17+
arch: amd64
18+
sonic_slave: sonic-slave-buster
19+
swss_common_artifact_name: sonic-swss-common
20+
sairedis_artifact_name: sonic-sairedis
21+
artifact_name: sonic-swss
22+
23+
- template: .azure-pipelines/build-template.yml
24+
parameters:
25+
arch: armhf
26+
timeout: 240
27+
pool: sonicbld
28+
sonic_slave: sonic-slave-buster-armhf
29+
swss_common_artifact_name: sonic-swss-common.armhf
30+
sairedis_artifact_name: sonic-sairedis.armhf
31+
artifact_name: sonic-swss.armhf
32+
33+
- template: .azure-pipelines/build-template.yml
34+
parameters:
35+
arch: arm64
36+
timeout: 240
37+
pool: sonicbld
38+
sonic_slave: sonic-slave-buster-arm64
39+
swss_common_artifact_name: sonic-swss-common.arm64
40+
sairedis_artifact_name: sonic-sairedis.arm64
41+
artifact_name: sonic-swss.arm64

0 commit comments

Comments
 (0)