Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azp: install sonic yangs during pipline build #144

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To install coherent packages related to YANG, it would be cleaner if you replace "-script" with the comment "# YANG MODELS" to run after libyang package install. If you want to keep the separate script, please add the same comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer keeping it as a separate step.. Will add a comment.. Step's displayName attribute anyway indicates "Install sonic yangs"

# 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