Skip to content

Commit

Permalink
(dsccommunity#567) Fix CICD
Browse files Browse the repository at this point in the history
CICD in Azure Devops appears to be broken.

Adding all of the features under `Web-Server` was breaking in Server
2019 core. It 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. An explicit command was added to use the
correct TLS protocol and fix the download.

The `win1803` server core image and the Windows 2012r2 image
`vs2015-win2012r2` are both being dropped from Azure Devops Pipelines.
The unit tests were moved to the `vs2017-win2016` pool image, and the
`Integration 2012R2` test job was removed entirely since the
`Integration 2016` step was already being handled by `vs2017-win2016`.
See the Microsoft blog post linked below for details.
https://devblogs.microsoft.com/devops/removing-older-images-in-azure-pipelines-hosted-pools/
  • Loading branch information
RandomNoun7 committed Feb 25, 2020
1 parent 59e8dcc commit 1255228
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 40 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
51 changes: 11 additions & 40 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ stages:
- job: Test_Unit
displayName: 'Unit'
pool:
vmImage: 'win1803'
vmImage: 'vs2017-win2016'
timeoutInMinutes: 0
steps:
- powershell: |
Expand Down Expand Up @@ -113,44 +113,6 @@ stages:
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'

- job: Test_Integration_2012R2
displayName: 'Integration 2012R2'
pool:
vmImage: 'vs2015-win2012r2'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false
- powershell: |
Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools -Name 'Web-Server' -Verbose
name: InstallWebServerFeature
- task: PowerShell@2
name: test
displayName: 'Run Integration Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
pwsh: false
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (Windows Server Core)'

- job: Test_Integration_2016
displayName: 'Integration 2016'
pool:
Expand Down Expand Up @@ -251,7 +213,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
Expand Down
1 change: 1 addition & 0 deletions tests/TestHelper/CommonTestHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1255228

Please sign in to comment.