forked from ordercloud-api/headstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.yml
More file actions
17 lines (16 loc) · 727 Bytes
/
Copy pathversion.yml
File metadata and controls
17 lines (16 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
steps:
- task: PowerShell@2
displayName: Get Build Number
inputs:
targetType: inline
script: >-
try {
# call out to hosted endpoint to get the current version and add one for this build
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$response = Invoke-RestMethod -Uri "https://headstartdemo-middleware.azurewebsites.net/env"
$newversion = [int]$response.BuildNumber.Split(".")[2] + 1
Write-Host "##vso[build.updatebuildnumber]1.0.$newversion.$(Build.BuildId)"
} catch {
$newversion = 1
Write-Host "##vso[build.updatebuildnumber]1.0.$newversion.$(Build.BuildId)"
}