Skip to content

Commit

Permalink
SqlServerDsc: Replaced Microsoft-hosted agent win1803 (dsccommunity#1480
Browse files Browse the repository at this point in the history
)

[skip ci]
  • Loading branch information
johlju authored Mar 23, 2020
1 parent 4458870 commit 38319b1
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 32 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
"powershell.codeFormatting.preset": "Custom",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"files.trimTrailingWhitespace": true,
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)

## [Unreleased]

### Changed

- SqlServerDsc
- Update the CI pipeline files.
- Replaced Microsoft-hosted agent (build image) `win1803` with `windows-2019`
([issue #1466](https://github.com/dsccommunity/SqlServerDsc/issues/1466)).

## [13.4.0] - 2020-03-18

### Added
Expand Down Expand Up @@ -38,7 +45,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
- Add .gitattributes file to checkout file correctly with CRLF.
- Updated .vscode/analyzersettings.psd1 file to correct use PSSA rules
and custom rules in VS Code.
- Fix hashtables to align with style guideline ([issue #1437](https://github.com/PowerShell/SqlServerDsc/issues/1437)).
- Fix hashtables to align with style guideline ([issue #1437](https://github.com/dsccommunity/SqlServerDsc/issues/1437)).
- Updated most examples to remove the need for the variable `$ConfigurationData`,
and fixed style issues.
- Ignore commit in `GitVersion.yml` to force the correct initial release.
Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ to use, and we would love to have contributions from the community.

## Core contribution guidelines

Please check out common DSC Community [guidelines](https://dsccommunity.org/guidelines).
Please check out common DSC Community [contributing guidelines](https://dsccommunity.org/guidelines/contributing).

## Running the Tests

If want to know how to run this module's tests you can look at the [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/#running-tests)

## Specific guidelines for SqlServerDsc

Expand Down
9 changes: 6 additions & 3 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
AddToPath = $true
Target = 'output\RequiredModules'
Parameters = @{
Repository = ''
}
}

Expand All @@ -17,12 +18,14 @@
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
xDscResourceDesigner = 'latest'
'DscResource.DocGenerator' = 'latest'

# Dependency for integration tests
LoopbackAdapter = 'latest'

# Prerequisites modules needed for examples or integration tests
PSDscResources = '2.12.0.0'
StorageDsc = '4.9.0.0'
NetworkingDsc = '7.4.0.0'
PSDscResources = '2.12.0.0'
StorageDsc = '4.9.0.0'
NetworkingDsc = '7.4.0.0'
}

85 changes: 61 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ trigger:
- "v*"
exclude:
- "*-*"
variables:
buildFolderName: output
buildArtifactName: output
testResultFolderName: testResults
testArtifactName: testResults

stages:
- stage: Build
Expand Down Expand Up @@ -37,8 +42,8 @@ stages:
- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifact'
inputs:
pathToPublish: 'output/'
artifactName: 'output'
pathToPublish: '$(buildFolderName)/'
artifactName: $(buildArtifactName)
publishLocation: 'Container'

- stage: Test
Expand All @@ -47,7 +52,7 @@ stages:
- job: Test_HQRM
displayName: 'HQRM'
pool:
vmImage: 'win1803'
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
Expand Down Expand Up @@ -75,21 +80,15 @@ stages:
- job: Test_Unit
displayName: 'Unit'
pool:
vmImage: 'win1803'
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
name: dscBuildVariable
displayName: 'Set Environment Variables'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
artifactName: $(buildArtifactName)
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: test
Expand All @@ -103,15 +102,14 @@ stages:
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Unit (Windows Server Core)'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Artifact'
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'
pathToPublish: '$(buildFolderName)/$(testResultFolderName)/'
artifactName: $(testArtifactName)
publishLocation: 'Container'

- job: Test_Integration_SQL2016
displayName: 'Integration (SQL2016)'
Expand All @@ -129,7 +127,7 @@ stages:
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
artifactName: $(buildArtifactName)
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: configureWinRM
Expand Down Expand Up @@ -173,7 +171,7 @@ stages:
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (SQL Server 2016 / Windows Server 2019)'

- job: Test_Integration_SQL2017
Expand All @@ -192,7 +190,7 @@ stages:
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
artifactName: $(buildArtifactName)
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: configureWinRM
Expand Down Expand Up @@ -236,8 +234,47 @@ stages:
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (SQL Server 2017 / Windows Server 2019)'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (Windows Server Core)'

- job: Code_Coverage
displayName: 'Publish Code Coverage'
dependsOn: Test_Unit
pool:
vmImage: 'ubuntu 16.04'
timeoutInMinutes: 0
steps:
- pwsh: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
name: dscBuildVariable
displayName: 'Set Environment Variables'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: $(buildArtifactName)
downloadPath: '$(Build.SourcesDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Test Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: $(testArtifactName)
downloadPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Azure Code Coverage'
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/$(buildFolderName)/$(dscBuildVariable.RepositoryName)'
- script: |
bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml"
displayName: 'Upload to Codecov.io'
condition: succeededOrFailed()
- stage: Deploy
dependsOn: Test
Expand All @@ -261,7 +298,7 @@ stages:
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
artifactName: $(buildArtifactName)
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: publishRelease
Expand Down
20 changes: 18 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ param
[validateScript(
{ Test-Path -Path $_ }
)]
$BuildConfig = './build.yaml',
$BuildConfig,

[Parameter()]
# A Specific folder to build the artefact into.
Expand All @@ -36,7 +36,7 @@ param
$RequiredModulesDirectory = $(Join-Path 'output' 'RequiredModules'),

[Parameter()]
[string[]]
[object[]]
$PesterScript,

# Filter which tags to run when invoking Pester tests
Expand Down Expand Up @@ -222,6 +222,22 @@ process

Begin
{
# Find build config if not specified
if (-not $BuildConfig) {
$config = Get-ChildItem -Path "$PSScriptRoot\*" -Include 'build.y*ml', 'build.psd1', 'build.json*' -ErrorAction:Ignore
if (-not $config -or ($config -is [array] -and $config.Length -le 0)) {
throw "No build configuration found. Specify path via -BuildConfig"
}
elseif ($config -is [array]) {
if ($config.Length -gt 1) {
throw "More than one build configuration found. Specify which one to use via -BuildConfig"
}
$BuildConfig = $config[0]
}
else {
$BuildConfig = $config
}
}
# Bootstrapping the environment before using Invoke-Build as task runner

if ($MyInvocation.ScriptName -notLike '*Invoke-Build.ps1')
Expand Down
7 changes: 6 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ BuildWorkflow:
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
- Generate_Conceptual_Help
- Generate_Wiki_Content

pack:
- build
Expand All @@ -38,7 +40,6 @@ BuildWorkflow:
- Publish_release_to_GitHub
- publish_module_to_gallery


####################################################
# PESTER Configuration #
####################################################
Expand All @@ -51,6 +52,8 @@ Pester:
ExcludeTag:
Tag:
CodeCoverageThreshold: 85
CodeCoverageOutputFile: JaCoCo_coverage.xml
CodeCoverageOutputFileEncoding: ascii

DscTest:
ExcludeTag:
Expand All @@ -68,6 +71,8 @@ Resolve-Dependency:
ModuleBuildTasks:
Sampler:
- '*.build.Sampler.ib.tasks'
DscResource.DocGenerator:
- 'Task.*'

TaskHeader: |
param($Path)
Expand Down

0 comments on commit 38319b1

Please sign in to comment.