@@ -7,18 +7,28 @@ trigger:
7
7
branches :
8
8
include :
9
9
- master
10
+ - 202???
10
11
11
12
pr :
12
13
branches :
13
14
include :
14
15
- master
16
+ - 202???
17
+
18
+ variables :
19
+ - name : BUILD_BRANCH
20
+ ${{ if eq(variables['Build.Reason'], 'PullRequest') }} :
21
+ value : $(System.PullRequest.TargetBranch)
22
+ ${{ else }} :
23
+ value : $(Build.SourceBranchName)
15
24
16
25
resources :
17
26
repositories :
18
27
- repository : sonic-mgmt-common
19
28
type : github
20
29
name : sonic-net/sonic-mgmt-common
21
30
endpoint : sonic-net
31
+ ref : refs/heads/$(BUILD_BRANCH)
22
32
23
33
stages :
24
34
- stage : Build
@@ -42,18 +52,19 @@ stages:
42
52
- checkout : sonic-mgmt-common
43
53
clean : true
44
54
submodules : recursive
45
- displayName : ' Checkout code '
55
+ displayName : ' Checkout sonic-mgmt-common '
46
56
47
57
- task : DownloadPipelineArtifact@2
48
58
inputs :
49
59
source : specific
50
60
project : build
51
- pipeline : 1
61
+ pipeline : 142
52
62
artifact : sonic-buildimage.vs
53
63
runVersion : ' latestFromBranch'
54
- runBranch : ' refs/heads/master '
64
+ runBranch : ' refs/heads/$(BUILD_BRANCH) '
55
65
patterns : |
56
66
target/debs/buster/libyang*.deb
67
+ target/python-wheels/bullseye/sonic_yang_models*.whl
57
68
displayName : " Download sonic buildimage"
58
69
59
70
- script : |
@@ -80,18 +91,21 @@ stages:
80
91
[[ ! -f python3_requirements.txt ]] || \
81
92
sudo pip3 install --no-cache-dir -r python3_requirements.txt
82
93
83
- popd
94
+ displayName: "Install dependency"
95
+
96
+ - script : |
97
+ sudo pip3 install ../target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
98
+ displayName: "Install sonic yangs"
84
99
100
+ - script : |
101
+ set -ex
85
102
pushd sonic-mgmt-common
86
103
87
104
NO_TEST_BINS=1 dpkg-buildpackage -rfakeroot -b -us -uc -j$(nproc)
88
-
89
- displayName: "Install dependency"
105
+ displayName: "Build sonic-mgmt-common"
90
106
91
107
- script : |
92
108
set -ex
93
- ls -l
94
-
95
109
pushd sonic-mgmt-framework
96
110
97
111
dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc) && cp ../*.deb $(Build.ArtifactStagingDirectory)/
0 commit comments