Skip to content

Commit

Permalink
parameterize azp
Browse files Browse the repository at this point in the history
  • Loading branch information
liushilongbuaa committed Nov 28, 2022
1 parent a7992c5 commit 195387b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
Empty file added abc
Empty file.
54 changes: 39 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,21 @@
trigger:
branches:
include:
- '*'
- master
- 20????
pr:
branches:
include:
- master
- 20????
schedules:
- cron: "0 0 * * 0"
displayName: Weekly Sunday build
branches:
include:
- master
- 20????
always: true

variables:
DIFF_COVER_CHECK_THRESHOLD: 70
Expand All @@ -20,35 +34,45 @@ container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest

steps:
- script: |
if [[ "$(Build.Reason)" == "PullRequest" ]];then
echo "##vso[task.setvariable variable=sourceBranch]$(System.PullRequest.TargetBranch)"
else
echo "##vso[task.setvariable variable=sourceBranch]$(Build.SourceBranchName)"
fi
displayName: "Get correct artifact downloading branch"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
pipeline: 142
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
runBranch: 'refs/heads/$(sourceBranch)'
patterns: |
target/debs/**/libnl-3-200_*.deb
target/debs/**/libnl-genl-3-200_*.deb
target/debs/**/libnl-route-3-200_*.deb
target/debs/**/libnl-nf-3-200_*.deb
target/debs/**/libhiredis0.14_*.deb
target/debs/**/libyang_1.*.deb
target/debs/**/libswsscommon_1.0.0_amd64.deb
target/debs/**/python3-swsscommon_1.0.0_amd64.deb
target/python-wheels/**/swsssdk-2.0.1-py3-none-any.whl
displayName: "Download artifacts from latest sonic-buildimage build"

- script: |
set -xe
sudo apt-get -y purge libhiredis-dev libnl-3-dev libnl-route-3-dev
sudo dpkg -i libnl-3-200_*.deb
sudo dpkg -i libnl-genl-3-200_*.deb
sudo dpkg -i libnl-route-3-200_*.deb
sudo dpkg -i libnl-nf-3-200_*.deb
sudo dpkg -i libhiredis0.14_*.deb
sudo dpkg -i libyang_1.*.deb
sudo dpkg -i libswsscommon_1.0.0_amd64.deb
sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb
workingDirectory: $(Pipeline.Workspace)/target/debs/buster/
sudo dpkg -i $(find . -name "*.deb")
workingDirectory: $(Pipeline.Workspace)/target/
displayName: 'Install Debian dependencies'

- script: |
set -xe
sudo pip3 install swsssdk-2.0.1-py3-none-any.whl
sudo pip3 install sonic_py_common-1.0-py3-none-any.whl
workingDirectory: $(Pipeline.Workspace)/target/python-wheels/buster/
find . -name "swsssdk-2.0.1-py3-none-any.whl" | xargs -i sudo pip3 install {}
find . -name "sonic_py_common-1.0-py3-none-any.whl" | xargs -i sudo pip3 install {}
workingDirectory: $(Pipeline.Workspace)/target/
displayName: 'Install Python dependencies'

- script: |
Expand Down

0 comments on commit 195387b

Please sign in to comment.