Skip to content

Commit

Permalink
[Ci]: Fix to trigger the publish pipeline in failure build issue (#10847
Browse files Browse the repository at this point in the history
)

Why I did it
It is not necessary to trigger the publish pipeline when build is failed.

How I did it
Remove the condition in the azp task, change to use template condition.
  • Loading branch information
xumia authored and qiluo-msft committed May 24, 2022
1 parent 51f4bf1 commit 455d44e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ jobs:
condition: failed()
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)'
displayName: "Archive failed sonic image"
- template: trigger-publish-artifacts-build.yml
parameters:
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: trigger-publish-artifacts-build.yml
parameters:
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
- ${{ parameters.postSteps }}
- template: cleanup.yml
jobGroups: ${{ parameters.jobGroups }}
Expand Down
2 changes: 0 additions & 2 deletions .azure-pipelines/trigger-publish-artifacts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ steps:
echo "##vso[task.setvariable variable=sonic_version]$sonic_version"
echo "##vso[task.setvariable variable=latest_tag]$latest_tag"
echo "##vso[task.setvariable variable=docker_tags]$docker_tags"
condition: ne(variables['Build.Reason'], 'PullRequest')
displayName: 'Set trigger build variables'
- task: TriggerBuild@4
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
definitionIsInCurrentTeamProject: false
teamProject: internal
Expand Down

0 comments on commit 455d44e

Please sign in to comment.