Skip to content

Commit

Permalink
Update CI pipeline files (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Jan 7, 2020
1 parent ea2f8f0 commit 388d107
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
- 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.
- Set a display name on all the jobs and tasks in the CI pipeline.
- SqlServerMaxDop
- Fix line endings in code which did not use the correct format.
- SqlAlwaysOnService
Expand All @@ -37,7 +38,8 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)

- SqlServerDsc
- Fixed unit tests to call the function `Invoke-TestSetup` outside the
try-block.
try-block.
- Update GitVersion.yml with the correct regular expression.
- SqlAlwaysOnService
- When failing to enable AlwaysOn the resource should now fail with an
error ([issue #1190](https://github.com/dsccommunity/SqlServerDsc/issues/1190)).
4 changes: 2 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ branches:
feature:
tag: useBranchName
increment: Minor
regex: f(eature(s)?)?[/-]
regex: f(eature(s)?)?[\/-]
source-branches: ['master']
hotfix:
tag: fix
increment: Patch
regex: (hot)?fix(es)?[/-]
regex: (hot)?fix(es)?[\/-]
source-branches: ['master']

ignore:
Expand Down
59 changes: 41 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ trigger:
stages:
- stage: Build
jobs:
- job: BuildModuleJob
- job: Package_Module
displayName: 'Package Module'
pool:
vmImage: 'ubuntu 16.04'
steps:
- task: GitVersion@5
name: gitversion
name: gitVersion
displayName: 'Evaluate Next Version'
inputs:
runtime: 'core'
configFilePath: 'GitVersion.yml'

- task: PowerShell@2
name: Build
name: package
displayName: 'Build & Package Module'
inputs:
filePath: './build.ps1'
arguments: '-ResolveDependency -tasks pack'
pwsh: true
env:
ModuleVersion: $(GitVersion.Informationalversion)

ModuleVersion: $(gitVersion.InformationalVersion)
- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifact'
inputs:
PathtoPublish: 'output/'
ArtifactName: 'output'
Expand All @@ -40,30 +42,35 @@ stages:
dependsOn: Build
jobs:
- job: Test_HQRM
displayName: 'HQRM'
pool:
vmImage: 'win1803'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: Test
name: test
displayName: 'Run HQRM Test'
inputs:
filePath: './build.ps1'
arguments: '-Tasks hqrmtest'
pwsh: false
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'HQRM'

- job: Test_Unit
displayName: 'Unit'
pool:
vmImage: 'win1803'
timeoutInMinutes: 0
Expand All @@ -72,33 +79,39 @@ stages:
$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
name: dscBuildVariable
displayName: 'Set Environment Variables'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: Test
name: test
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
pwsh: false
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Unit (Windows Server Core)'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage'
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(DscBuildVariable.RepositoryName)'
pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'

- job: Test_Integration_SQL2016
displayName: 'Integration (SQL2016)'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
Expand All @@ -109,13 +122,15 @@ stages:
configuration: Integration_SQL2016
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: ConfigureWinRM
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
Expand Down Expand Up @@ -148,15 +163,17 @@ stages:
'tests/Integration/MSFT_SqlServerSecureConnection.Integration.Tests.ps1'
'tests/Integration/MSFT_SqlScriptQuery.Integration.Tests.ps1'
)
name: Test
name: test
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (SQL Server 2016 / Windows Server 2019)'

- job: Test_Integration_SQL2017
displayName: 'Integration (SQL2017)'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
Expand All @@ -167,13 +184,15 @@ stages:
configuration: Integration_SQL2017
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: ConfigureWinRM
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
Expand Down Expand Up @@ -206,8 +225,9 @@ stages:
'tests/Integration/MSFT_SqlServerSecureConnection.Integration.Tests.ps1'
'tests/Integration/MSFT_SqlScriptQuery.Integration.Tests.ps1'
)
name: Test
name: test
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
Expand All @@ -216,7 +236,6 @@ stages:

- stage: Deploy
dependsOn: Test
# Only execute deploy stage if we're on master and previous stage succeeded
condition: |
and(
succeeded(),
Expand All @@ -226,18 +245,21 @@ stages:
)
)
jobs:
- job: Deploy_Artefact
- job: Deploy_Module
displayName: 'Deploy Module'
pool:
vmImage: 'ubuntu 16.04'
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
- task: PowerShell@2
name: publish_prerelease
name: publishRelease
displayName: 'Publish Release'
inputs:
filePath: './build.ps1'
arguments: '-tasks publish'
Expand All @@ -246,7 +268,8 @@ stages:
GitHubToken: $(GitHubToken)
GalleryApiToken: $(GalleryApiToken)
- task: PowerShell@2
name: send_changelog_PR
name: sendChangelogPR
displayName: 'Send Changelog PR'
inputs:
filePath: './build.ps1'
arguments: '-tasks Create_ChangeLog_GitHub_PR'
Expand Down

0 comments on commit 388d107

Please sign in to comment.