Skip to content

Commit 7198b9a

Browse files
authored
Fail Build Team Deprecated PowerShell Tasks (#19472)
* Fail Build Team Deprecated PowerShell Tasks * change feature flag retrieve code
1 parent 87ee0a7 commit 7198b9a

21 files changed

+67
-14
lines changed

Tasks/ChefKnifeV1/ChefKnife.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ try
3131
#setting up chef repo with the chef subscription details fetched before
3232
Initialize-ChefRepo $connectedServiceDetails
3333
Invoke-Expression -Command $scriptCommand
34+
$featureFlags = @{
35+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
36+
}
37+
if ($featureFlags.failDeprecatedBuildTask)
38+
{
39+
throw "The ChefKnife@1 (Run scripts with Knife commands on your Chef workstation) task has been deprecated since March 5, 2018 and will soon be retired. To continue to use Chef Knife, use the Knife client directly from a bash/pwsh/script task. See https://docs.chef.io/workstation/knife_client/."
40+
}
3441
}
3542
finally
3643
{

Tasks/ChefKnifeV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 234,
19+
"Minor": 235,
2020
"Patch": 0
2121
},
2222
"deprecated": true,

Tasks/ChefKnifeV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 234,
19+
"Minor": 235,
2020
"Patch": 0
2121
},
2222
"deprecated": true,

Tasks/ChefV1/Chef.ps1

+8
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ try
186186
Invoke-Knife @("upload environments/$environment.json")
187187

188188
Wait-ForChefNodeRunsToComplete $environment $totalWaitTimeForRunsInMinutes $pollIntervalForRunsInSeconds
189+
190+
$featureFlags = @{
191+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
192+
}
193+
if ($featureFlags.failDeprecatedBuildTask)
194+
{
195+
throw "The Chef@1 (Deploy to Chef environments by editing environment attributes) task has been deprecated since March 5, 2018 and will soon be retired. To continue to use Chef, use the Chef CLI directly from a bash/pwsh/script task. See https://github.com/chef/chef-cli."
196+
}
189197
}
190198
finally
191199
{

Tasks/ChefV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 1,
20-
"Minor": 234,
20+
"Minor": 235,
2121
"Patch": 0
2222
},
2323
"deprecated": true,

Tasks/ChefV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 1,
20-
"Minor": 234,
20+
"Minor": 235,
2121
"Patch": 0
2222
},
2323
"deprecated": true,

Tasks/IISWebAppDeployment/DeployIISWebApp.ps1

+8
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,12 @@ if(-not [string]::IsNullOrEmpty($errorMessage))
154154
throw "$errorMessage $helpMessage"
155155
}
156156

157+
$featureFlags = @{
158+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
159+
}
160+
if ($featureFlags.failDeprecatedBuildTask)
161+
{
162+
throw "The IISWebAppDeployment@1 (IIS Web App deployment) task has been deprecated since October 5, 2018 and will soon be retired. Use the 'IIS Web App Deployment Using WinRM' extension instead: https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.iiswebapp."
163+
}
164+
157165
Write-Output ( Get-LocalizedString -Key "Successfully deployed IIS Web Deploy Package : {0}" -ArgumentList $webDeployPackage)

Tasks/IISWebAppDeployment/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"demands": [],

Tasks/IISWebAppDeployment/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"demands": [],

Tasks/QuickPerfTestV1/Invoke-QuickPerfTest.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ else
187187
Write-Error ("Failed to connect to the endpoint '{0}' for VSO account '{1}'" -f $EndpointName, $VSOAccountUrl)
188188
}
189189

190+
$featureFlags = @{
191+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
192+
}
193+
if ($featureFlags.failDeprecatedBuildTask)
194+
{
195+
throw "The QuickPerfTest@1 (Cloud-based web performance test) task has been deprecated since June 4, 2019 and will soon be retired. Use the AzureLoadTest@1 task instead."
196+
}
190197

191198
Write-Output "Quick Perf Test Script execution completed"
192199

Tasks/QuickPerfTestV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"deprecated": true,

Tasks/QuickPerfTestV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"deprecated": true,

Tasks/RunJMeterLoadTestV1/Start-ApacheJMeterTest.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,12 @@ else
184184
("Connection '{0}' failed for service '{1}'" -f $connectedServiceName, $connectedServiceDetails.Url.AbsoluteUri) >> $summaryFile
185185
}
186186

187+
$featureFlags = @{
188+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
189+
}
190+
if ($featureFlags.failDeprecatedBuildTask)
191+
{
192+
throw "The ApacheJMeterLoadTest@1 (Cloud-based Apache JMeter load test) task haas been deprecated since June 4, 2019 and will soon be retired. For cloud-based load testing, use the AzureLoadTest@1 task."
193+
}
187194
WriteTaskMessages "JMeter Test Script execution completed"
188195

Tasks/RunJMeterLoadTestV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"deprecated": true,

Tasks/RunJMeterLoadTestV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"deprecated": true,

Tasks/RunLoadTestV1/Start-CloudLoadTest.ps1

+8
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,13 @@ else
233233
Write-Error ("Connection '{0}' failed for service '{1}'" -f $connectedServiceName, $connectedServiceDetails.Url.AbsoluteUri)
234234
}
235235

236+
$featureFlags = @{
237+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
238+
}
239+
if ($featureFlags.failDeprecatedBuildTask)
240+
{
241+
throw "The CloudLoadTest@1 (Cloud-based load test) has been deprecated since June 4, 2019 and will soon be retired. Use the AzureLoadTest@1 task instead."
242+
}
243+
236244
WriteTaskMessages "Load Test Script execution completed"
237245

Tasks/RunLoadTestV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"deprecated": true,

Tasks/RunLoadTestV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"deprecated": true,

Tasks/SqlServerDacpacDeployment/DeployToSqlServer.ps1

+8
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,12 @@ if(-not [string]::IsNullOrEmpty($errorMessage))
8181
throw "$errorMessage $helpMessage"
8282
}
8383

84+
$featureFlags = @{
85+
failDeprecatedBuildTask = [System.Convert]::ToBoolean($env:FAIL_DEPRECATED_BUILD_TASK)
86+
}
87+
if ($featureFlags.failDeprecatedBuildTask)
88+
{
89+
throw "The SqlServerDacpacDeployment@1 (SQL Server database deploy) task has been deprecated since October 5, 2018 and will soon be retired. Use the 'IIS Web App Deployment Using WinRM' extension instead: https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.iiswebapp. For Azure SQL Database use the SqlAzureDacpacDeployment@1 task."
90+
}
91+
8492
Write-Output ( Get-LocalizedString -Key "Successfully deployed Sql Dacpac File : {0}" -ArgumentList $dacpacFile)

Tasks/SqlServerDacpacDeployment/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"demands": [],

Tasks/SqlServerDacpacDeployment/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 234,
16+
"Minor": 235,
1717
"Patch": 0
1818
},
1919
"demands": [],

0 commit comments

Comments
 (0)