From 195387b276705c7ab06b2016e169687c603a73e5 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Mon, 8 Aug 2022 13:12:24 +0800 Subject: [PATCH] parameterize azp --- abc | 0 azure-pipelines.yml | 54 ++++++++++++++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 abc diff --git a/abc b/abc new file mode 100644 index 0000000..e69de29 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4cf5b0f..576009a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 @@ -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: |