Skip to content

Commit

Permalink
Azp: install sonic yangs during pipline build
Browse files Browse the repository at this point in the history
* Download & install sonic_yang_models.whl before telemetry build.
  Translib will start using these sonic yangs during build
* Download source code and artifacts for the build branch only
* Use pipeline 142 for downloading sonic-buildimage.vs artifacts,
  which runs on all branches
  • Loading branch information
sachinholla committed Oct 13, 2023
1 parent 8e13400 commit 280082a
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@ pr:
- 202???
- 201???

variables:
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.TargetBranch)
${{ else }}:
value: $(Build.SourceBranchName)

resources:
repositories:
- repository: sonic-mgmt-common
type: github
name: sonic-net/sonic-mgmt-common
endpoint: sonic-net
ref: refs/heads/$(BUILD_BRANCH)
- repository: sonic-swss-common
type: github
name: sonic-net/sonic-swss-common
endpoint: sonic-net
ref: refs/heads/$(BUILD_BRANCH)

stages:
- stage: Build
Expand Down Expand Up @@ -66,25 +75,16 @@ stages:
inputs:
source: specific
project: build
pipeline: 1
pipeline: 142
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
patterns: |
target/debs/bullseye/libyang*.deb
target/debs/bullseye/libnl*.deb
target/python-wheels/bullseye/sonic_yang_models*.whl
displayName: "Download bullseye debs"

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 127
artifact: sonic-mgmt-common
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic-mgmt-common"

- script: |
# PYTEST
sudo pip3 install -U pytest
Expand All @@ -101,6 +101,10 @@ stages:
sudo dpkg -i ../target/debs/bullseye/libyang*1.0.73*.deb
displayName: "Install dependency"
- script: |
sudo pip3 install ../target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
displayName: "Install sonic yangs"
- script: |
# LIBSWSSCOMMON
sudo apt-get -y purge libnl-3-dev libnl-route-3-dev
Expand All @@ -126,7 +130,7 @@ stages:
pipeline: Azure.sonic-swss-common
artifact: sonic-swss-common
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
displayName: "Download sonic-swss-common"

- script: |
Expand Down

0 comments on commit 280082a

Please sign in to comment.