From 4978a1889290b22db564c65eb5a3b832264bcd17 Mon Sep 17 00:00:00 2001 From: Denis Rumyantsev Date: Thu, 13 Jul 2023 08:01:51 +0200 Subject: [PATCH] Run build stage only from the master branch (#4348) * fix ci buildStageOnly on master * disable test agent proxy --------- Co-authored-by: Kirill Ivlev --- .azure-pipelines/build-job.yml | 2 +- .azure-pipelines/pipeline.yml | 24 ++++++------------------ .vsts.ci.yml | 5 +++++ .vsts.release.yml | 5 ++++- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 5a86bf4152..79597363f2 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -86,7 +86,7 @@ jobs: layoutRoot: '_layout/${{ parameters.os }}-${{ parameters.arch }}' DisableCFSDetector: true DisableDockerDetector: true - NugetSecurityAnalysisWarningLevel: "none" + nugetMultiFeedWarnLevel: none ${{ if eq(parameters.os, 'rhel.6') }}: AGENT_USE_NODE10: true diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index ec9605a943..32a6ecdd58 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -83,34 +83,22 @@ stages: vmImage: ubuntu-latest variables: DisableDockerDetector: true - NugetSecurityAnalysisWarningLevel: none + nugetMultiFeedWarnLevel: none steps: - bash: | cd ./.azure-pipelines/scripts/ npm install axios minimist - source="$(Build.SourceBranch)" - prefix="refs/heads/" - - if [[ "${source}" == "${prefix}"* ]]; then - branch="${source#"${prefix}"}" - - if [[ "${branch}" == "master" ]]; then - branch="${{ parameters.branch }}" - fi - - echo "Canary \"branch\" parameter: \"${branch}\"" - else - echo "##vso[task.logissue type=error]This test is supported only if the build source branch name is specified directly" - - exit 1 - fi + releaseBranch="${{ parameters.branch }}" + sourceBranch="$(Build.SourceBranch)" + branch="${releaseBranch:-"${sourceBranch}"}" + echo "Canary \"branch\" parameter: \"${branch}\"" node ./run-and-verify.js \ --projectUrl "$(CANARY_PROJECT_URL)" \ --pipelineId "$(CANARY_PIPELINE_ID)" \ --token "$(CANARY_PAT)" \ - --templateParameters "{ \"branch\": \"${branch}\" }" + --templateParameters "{ \"branch\": \"${branch}\", \"template_timeout\": 2 }" displayName: Test Proxy Agent # Windows (x64) diff --git a/.vsts.ci.yml b/.vsts.ci.yml index 9917e704df..6d398d6e89 100644 --- a/.vsts.ci.yml +++ b/.vsts.ci.yml @@ -34,6 +34,10 @@ parameters: - name: skipRhelRelease type: boolean default: true +- name: testProxyAgent + type: boolean + default: false + displayName: Test Proxy Agent pr: branches: @@ -50,6 +54,7 @@ extends: publishArtifacts: ${{ ne(variables['Build.Reason'], 'PullRequest') }} buildAlternatePackage: false skipRhelRelease: ${{ parameters.skipRhelRelease }} + testProxyAgent: ${{ parameters.testProxyAgent }} win_x64: ${{ parameters.win_x64 }} win_x86: ${{ parameters.win_x86 }} linux_x64: ${{ parameters.linux_x64 }} diff --git a/.vsts.release.yml b/.vsts.release.yml index 2a9535043f..e9e783dcfd 100644 --- a/.vsts.release.yml +++ b/.vsts.release.yml @@ -36,7 +36,10 @@ parameters: displayName: Test Proxy Agent variables: - releaseBranch: releases/${{ parameters.version }} + ${{ if parameters.buildStageOnly }}: + releaseBranch: '' + ${{ else }}: + releaseBranch: releases/${{ parameters.version }} extends: template: .azure-pipelines/pipeline.yml