From 9183cbbc30f3aa81334e0b783e4caa7c677a6347 Mon Sep 17 00:00:00 2001 From: Bill Hurt Date: Fri, 21 Feb 2020 15:34:24 -0800 Subject: [PATCH] (#567) Fix CICD CICD in Azure Devops appears to be broken. Adding all of the features under `Web-Server` was breaking in Server 2019 core, was not capable of easily adding the .NET3.5 features. It turned out that those features were not required so they were dropped in favor of a more granular set of features for that image. SSL downloads from the technet gallery were broken in the unit tests due to incorrect TLS protocol. The `win1803` server core image and the Windows 2012r2 image `vs2015-win2012r2` are both being dropped from Azure Devops Pipelines and have both been replaced in this commit by `vs2017-win2016` as per Microsofts recommendation at https://devblogs.microsoft.com/devops/removing-older-images-in-azure-pipelines-hosted-pools/ --- CHANGELOG.md | 1 + azure-pipelines.yml | 15 ++++++++++++--- tests/TestHelper/CommonTestHelper.psm1 | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee12d4e7e..69c00d896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) - xWebAdminstration - Integration tests are running on more Microsoft-hosted agents to test all possible operating systems ([issue #550](https://github.com/PowerShell/xWebAdministration/issues/550)). + - Fix a few lingering bugs in CICD ([issue #567](https://github.com/PowerShell/xWebAdministration/issues/567)) ### Changed diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 61a27352e..e2777d9a2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -75,7 +75,7 @@ stages: - job: Test_Unit displayName: 'Unit' pool: - vmImage: 'win1803' + vmImage: 'vs2017-win2016' timeoutInMinutes: 0 steps: - powershell: | @@ -116,7 +116,7 @@ stages: - job: Test_Integration_2012R2 displayName: 'Integration 2012R2' pool: - vmImage: 'vs2015-win2012r2' + vmImage: 'vs2017-win2016' timeoutInMinutes: 0 steps: - task: DownloadBuildArtifacts@0 @@ -251,7 +251,16 @@ stages: - powershell: | Set-Service -Name wuauserv -StartupType Manual -Verbose Start-Service -name wuauserv -Verbose - Install-WindowsFeature -IncludeAllSubFeature -Name 'Web-Server' -Verbose + $features = @( + 'Web-Common-Http','Web-Health','Web-Performance', + 'Web-Security','Web-AppInit', + 'Web-CGI','Web-ISAPI-Ext','Web-ISAPI-Filter', + 'Web-Includes','Web-WebSockets', 'Web-Scripting-Tools', 'Web-Mgmt-Tools' + ) + foreach($feature in $features) { + Write-Host $feature + Install-WindowsFeature -IncludeAllSubFeature -Name $feature -Verbose + } name: InstallWebServerFeature - task: PowerShell@2 name: test diff --git a/tests/TestHelper/CommonTestHelper.psm1 b/tests/TestHelper/CommonTestHelper.psm1 index c0c48f1d3..70feb0c8a 100644 --- a/tests/TestHelper/CommonTestHelper.psm1 +++ b/tests/TestHelper/CommonTestHelper.psm1 @@ -41,6 +41,7 @@ function Install-NewSelfSignedCertificateExScript Remove-Item -Path $newSelfSignedCertZipPath -Force } + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-WebRequest -Uri $newSelfSignedCertURL -OutFile $newSelfSignedCertZipPath Add-Type -AssemblyName System.IO.Compression.FileSystem