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 code generators and app modues use these sonic yangs
* 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 authored and anand-kumar-subramanian committed Jan 18, 2024
1 parent c44d154 commit 280b7f4
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 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,12 @@ stages:
sudo dpkg -i ../target/debs/bullseye/libyang*1.0.73*.deb
displayName: "Install dependency"
- script: |
# SONIC YANGS
set -ex
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 +132,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 280b7f4

Please sign in to comment.