From c54daed3f064b9f416dd7997cd097830f54a7f38 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 6 Jan 2020 20:33:19 +0100 Subject: [PATCH] Update CI pipeline files (#14) --- CHANGELOG.md | 10 +++++++++ GitVersion.yml | 16 ++------------- azure-pipelines.yml | 50 ++++++++++++++++++++++++++++++++------------- 3 files changed, 48 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ff695..dc670c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- GPRegistryPolicyDsc + - Update GitVersion.yml with the correct regular expression. + +### Changed + +- GPRegistryPolicyDsc + - Set a display name on all the jobs and tasks in the CI pipeline. + ## [1.1.0] - 2020-01-05 ### Added diff --git a/GitVersion.yml b/GitVersion.yml index 72cd18b..5b9442c 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -13,26 +13,14 @@ 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: sha: [] merge-message-formats: {} - - -# feature: -# tag: useBranchName -# increment: Minor -# regex: f(eature(s)?)?[/-] -# source-branches: ['master'] -# hotfix: -# tag: fix -# increment: Patch -# regex: (hot)?fix(es)?[/-] -# source-branches: ['master'] diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a9d48e4..ce200f9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,25 +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' @@ -39,23 +42,27 @@ 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' @@ -63,6 +70,7 @@ stages: testRunTitle: 'HQRM' - job: Test_Unit + displayName: 'Unit' pool: vmImage: 'win1803' timeoutInMinutes: 0 @@ -71,56 +79,66 @@ 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 + displayName: 'Integration' 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: ConfigureWinRM + name: configureWinRM + displayName: 'Configure WinRM' inputs: targetType: 'inline' script: 'winrm quickconfig -quiet' pwsh: false - task: PowerShell@2 - name: Test + 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' @@ -138,18 +156,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' @@ -158,7 +179,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'