diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5cdae841..e2b7151d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 @@ -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 @@ -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 @@ -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: |