Skip to content

Commit

Permalink
Merge pull request #54051 from JoeRobich/set-build-number
Browse files Browse the repository at this point in the history
Update official build number in separate job
  • Loading branch information
JoeRobich authored Jun 12, 2021
2 parents 7475a4a + 6dd8319 commit 47340e0
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@ variables:
value: $(dn-bot-devdiv-drop-rw-code-rw)

stages:
- stage: setup
displayName: Build Setup

jobs:
- job: SetBuildNumber
pool:
vmImage: vs2017-win2016
steps:
# Make sure our two pipelines generate builds with distinct build numbers to avoid confliction.
# i.e. DevDiv builds will have even rev# whereas dnceng builds will be odd.
- task: PowerShell@2
displayName: Update BuildNumber
inputs:
filePath: 'eng\update-build-number.ps1'
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
arguments: '-buildNumber $(Build.BuildNumber) -oddOrEven even'
${{ if eq(variables['System.TeamProject'], 'internal') }}:
arguments: '-buildNumber $(Build.BuildNumber) -oddOrEven odd'
condition: eq(variables['System.JobAttempt'], '1')

- stage: build
displayName: Build and Test

Expand Down Expand Up @@ -69,18 +89,6 @@ stages:
queue: BuildPool.Server.Amd64.VS2017

steps:
# Make sure our two pipelines generate builds with distinct build numbers to avoid confliction.
# i.e. DevDiv builds will have even rev# whereas dnceng builds will be odd.
- task: PowerShell@2
displayName: Update BuildNumber
inputs:
filePath: 'eng\update-build-number.ps1'
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
arguments: '-buildNumber $(Build.BuildNumber) -oddOrEven even'
${{ if eq(variables['System.TeamProject'], 'internal') }}:
arguments: '-buildNumber $(Build.BuildNumber) -oddOrEven odd'
condition: eq(variables['System.JobAttempt'], '1')

- powershell: Write-Host "##vso[task.setvariable variable=SourceBranchName]$('$(Build.SourceBranch)'.Substring('refs/heads/'.Length))"
displayName: Setting SourceBranchName variable
condition: succeeded()
Expand Down

0 comments on commit 47340e0

Please sign in to comment.