Skip to content

Commit

Permalink
Run build stage only from the master branch (#4348)
Browse files Browse the repository at this point in the history
* fix ci buildStageOnly on master

* disable test agent proxy

---------

Co-authored-by: Kirill Ivlev <v-kivlev@microsoft.com>
  • Loading branch information
DenisRumyantsev and kirill-ivlev authored Jul 13, 2023
1 parent cdf2ad8 commit 4978a18
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 6 additions & 18 deletions .azure-pipelines/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions .vsts.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ parameters:
- name: skipRhelRelease
type: boolean
default: true
- name: testProxyAgent
type: boolean
default: false
displayName: Test Proxy Agent

pr:
branches:
Expand All @@ -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 }}
Expand Down
5 changes: 4 additions & 1 deletion .vsts.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4978a18

Please sign in to comment.