-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines-56.yml
41 lines (35 loc) · 1.29 KB
/
azure-pipelines-56.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
old_date: '20210601'
latest_date: '20210603'
# PSI: ${{ (variables.latest_date-variables.old_date)/56+1}}
# totalsprints: ${{ (variables.latest_date-variables.old_date)/14 }}
# sprint: ${{ variables.totalsprints%4+1 }}
majorversion: '2.'
dot: '.'
#name: '$(majorversion)$(Year:yy)$(PSI)$(dot)$(sprint)$(dot)$(Date:MMdd)'
trigger: none
pr: none
pool:
vmImage: ubuntu-latest
name: 'Set dynamically below in a task'
steps:
- task: PowerShell@2
displayName: Set the name of the build (i.e. the Build.BuildNumber)
inputs:
targetType: 'inline'
script: |
[int] $PSI = (([int] $(latest_date))-([int] $(old_date)))/56+1
[int] $totalsprints = ( ([int] $(latest_date))-([int] $(old_date)))/14
[int] $sprint = $totalsprints%4+1
$year = Get-Date -Format "yy"
$monthDay = Get-Date -Format "MMdd"
[string] $buildName = "$(majorversion)$year$PSI.$sprint.$monthDay"
Write-Host "Setting the name of the build to '$buildName'."
Write-Host "##vso[build.updatebuildnumber]$buildName"