@@ -7,14 +7,6 @@ parameters:
7
7
displayName : OOB release Service
8
8
type : string
9
9
default : Databricks
10
- - name : BumpUpVersion
11
- displayName : Need BumpUpVersion
12
- type : boolean
13
- default : true
14
- - name : PreviewSuffix
15
- displayName : Add "-Preview" Suffix after version number
16
- type : boolean
17
- default : false
18
10
- name : Preview
19
11
displayName : Is preview version(Including < 1.0.0)
20
12
type : boolean
@@ -28,43 +20,9 @@ stages:
28
20
- job : BumpUpVersion
29
21
timeoutInMinutes : 180
30
22
pool : pool-windows-2019
23
+ variables :
24
+ NeedBumpUp : true
31
25
steps :
32
- - task : DotNetCoreCLI@2
33
- displayName : Build
34
- condition : and(succeeded(), eq('${{ parameters.BumpUpVersion }}', 'true'))
35
- inputs :
36
- command : custom
37
- custom : msbuild
38
- arguments : ' build.proj "/t:Clean;Build" /p:Configuration=Release'
39
- - pwsh : |
40
- .\tools\RunVersionController.ps1 -ModuleName "Az.${{ parameters.ServiceName }}”
41
- displayName: 'Bump up version'
42
- condition: and(succeeded(), eq('${{ parameters.BumpUpVersion }}', 'true'))
43
- - task : AzurePowerShell@5
44
- inputs :
45
- azureSubscription : ' $(AzureSubscription)'
46
- ScriptType : ' InlineScript'
47
- azurePowerShellVersion : ' LatestVersion'
48
- inline : |
49
- Set-AzContext -Tenant $(TenantId) -SubscriptionId $(SubscriptionId)
50
- $Token = Get-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name $(KeyVaultAccount) -AsPlainText
51
- git config user.email "[email protected] "
52
- git config user.name "azure-powershell-bot"
53
- git checkout -b codeoob/${{ parameters.ServiceName }}
54
- git add -A
55
- if ($${{ parameters.Preview }}) {
56
- git reset -- ./tools/Tools.Common/SerializedCmdlets/Az.${{ parameters.ServiceName }}.json
57
- }
58
- git commit -m "Bump up version for ${{ parameters.ServiceName }}"
59
- git remote set-url origin https://azure-powershell-bot:[email protected] /Azure/azure-powershell.git;
60
- git push origin codeoob/${{ parameters.ServiceName }} --force;
61
- $Title = "Migrate ${{ parameters.ServiceName }} from oob to main"
62
- $HeadBranch = "codeoob/${{ parameters.ServiceName }}"
63
- $BaseBranch = "${{ parameters.TargetBranch }}"
64
- $Description = "Migrate ${{ parameters.ServiceName }} from oob to ${{parameters.TargetBranch}}"
65
- ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $Token -Description $Description -Draft $true
66
- displayName : Create PR to main branch
67
- condition : and(succeeded(), eq('${{ parameters.BumpUpVersion }}', 'true'))
68
26
- task : PowerShell@2
69
27
displayName : get changelog info
70
28
name : outputinfo
@@ -79,8 +37,9 @@ stages:
79
37
$versionNumber = $matches.Groups[1].Value
80
38
$versionChanges = $matches.Groups[2].Value.Trim()
81
39
}
82
- if ($${{ parameters.PreviewSuffix }}) {
40
+ if ($${{ parameters.Preview }} -and ([version]$versionNumber -ge [version]1.0.0) ) {
83
41
$versionNumber += "-preview"
42
+ echo "##vso[task.setvariable variable=NeedBumpUp]false"
84
43
}
85
44
$jsonData = @{
86
45
ModuleName = "${{ parameters.ServiceName }}"
@@ -115,11 +74,49 @@ stages:
115
74
"@
116
75
$readmePath = "OOB/README.md"
117
76
$content | Out-File -FilePath $readmePath
118
- if ($${{ parameters.BumpUpVersion }} -eq $true) {
77
+
78
+ if ($(NeedBumpUp) -eq 'true') {
119
79
echo "##vso[task.setvariable variable=BumpUpBranch;isOutput=true]codeoob/${{ parameters.ServiceName }}"
120
80
} else {
121
81
echo "##vso[task.setvariable variable=BumpUpBranch;isOutput=true]none"
122
82
}
83
+ - task : DotNetCoreCLI@2
84
+ displayName : Build
85
+ condition : and(succeeded(), eq('$(NeedBumpUp)', 'true'))
86
+ inputs :
87
+ command : custom
88
+ custom : msbuild
89
+ arguments : ' build.proj "/t:Clean;Build" /p:Configuration=Release'
90
+ - pwsh : |
91
+ .\tools\RunVersionController.ps1 -ModuleName "Az.${{ parameters.ServiceName }}”
92
+ displayName: 'Bump up version'
93
+ condition: and(succeeded(), eq('$(NeedBumpUp)', 'true'))
94
+ - task : AzurePowerShell@5
95
+ inputs :
96
+ azureSubscription : ' $(AzureSubscription)'
97
+ ScriptType : ' InlineScript'
98
+ azurePowerShellVersion : ' LatestVersion'
99
+ inline : |
100
+ Set-AzContext -Tenant $(TenantId) -SubscriptionId $(SubscriptionId)
101
+ $Token = Get-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name $(KeyVaultAccount) -AsPlainText
102
+ git config user.email "[email protected] "
103
+ git config user.name "azure-powershell-bot"
104
+ git checkout -b codeoob/${{ parameters.ServiceName }}
105
+ git add -A
106
+ if ($${{ parameters.Preview }}) {
107
+ git reset -- ./tools/Tools.Common/SerializedCmdlets/Az.${{ parameters.ServiceName }}.json
108
+ }
109
+ git commit -m "Bump up version for ${{ parameters.ServiceName }}"
110
+ git remote set-url origin https://azure-powershell-bot:[email protected] /Azure/azure-powershell.git;
111
+ git push origin codeoob/${{ parameters.ServiceName }} --force;
112
+ $Title = "Migrate ${{ parameters.ServiceName }} from oob to main"
113
+ $HeadBranch = "codeoob/${{ parameters.ServiceName }}"
114
+ $BaseBranch = "${{ parameters.TargetBranch }}"
115
+ $Description = "Migrate ${{ parameters.ServiceName }} from oob to ${{parameters.TargetBranch}}"
116
+ ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $Token -Description $Description -Draft $true
117
+ displayName : Create PR to main branch
118
+ condition : and(succeeded(), eq('$(NeedBumpUp)', 'true'))
119
+
123
120
124
121
- task : PowerShell@2
125
122
displayName : publish oob tools
0 commit comments