diff --git a/.azure-pipelines/azure-pipelines.yaml b/.azure-pipelines/azure-pipelines.yaml new file mode 100644 index 0000000..c2f14e2 --- /dev/null +++ b/.azure-pipelines/azure-pipelines.yaml @@ -0,0 +1,110 @@ +# Azure DevOps +# CI pipeline for PSRule.Rules.Kubernetes + +variables: + version: '0.1.0' + buildConfiguration: 'Release' + + # Use build number format, i.e. 0.1.0-B181101 +name: $(version)-B$(date:yyMM)$(rev:rr) + +trigger: + branches: + include: + - 'master' + tags: + include: + - 'v0.*' + +pr: + branches: + include: + - 'master' + +stages: + +# Build pipeline +- stage: Build + displayName: Build + jobs: + - job: + strategy: + matrix: + Linux: + imageName: 'ubuntu-16.04' + MacOS: + imageName: 'macos-10.13' + Windows: + imageName: 'vs2017-win2016' + publishModule: 'true' + analysis: 'true' + coverage: 'true' + pool: + vmImage: $(imageName) + steps: + + # Install pipeline dependencies and build module + - powershell: ./scripts/pipeline-build.ps1 -File ./pipeline.build.ps1 -Configuration $(buildConfiguration) -ModuleVersion $(Build.BuildNumber) -ReleaseVersion "$(Release.Version)" + displayName: 'Build module' + + # Pester test results + - task: PublishTestResults@2 + displayName: 'Publish Pester results' + inputs: + testRunTitle: 'Pester on $(imageName)' + testRunner: NUnit + testResultsFiles: 'reports/pester-unit.xml' + mergeTestResults: true + platform: $(imageName) + configuration: $(buildConfiguration) + publishRunAttachments: true + condition: succeededOrFailed() + + # PSRule results + # - task: PublishTestResults@2 + # displayName: 'Publish PSRule results' + # inputs: + # testRunTitle: 'PSRule on $(imageName)' + # testRunner: NUnit + # testResultsFiles: 'reports/rule.report.xml' + # mergeTestResults: true + # platform: $(imageName) + # configuration: $(buildConfiguration) + # publishRunAttachments: true + # condition: succeededOrFailed() + + # Publish Code Coverage Results + - task: PublishCodeCoverageResults@1 + displayName: 'Publish Pester code coverage' + inputs: + codeCoverageTool: 'JaCoCo' + summaryFileLocation: 'reports/pester-coverage.xml' + condition: eq(variables['coverage'], 'true') + + # Generate artifacts + - task: PublishPipelineArtifact@0 + displayName: 'Publish module' + inputs: + artifactName: PSRule.Rules.Kubernetes + targetPath: out/modules/PSRule.Rules.Kubernetes + condition: and(succeeded(), eq(variables['publishModule'], 'true')) + +# Release pipeline +- stage: Release + displayName: Release + dependsOn: Build + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v0.') + jobs: + - job: + displayName: Live + pool: + vmImage: 'ubuntu-16.04' + steps: + - task: DownloadPipelineArtifact@1 + displayName: 'Download module' + inputs: + artifactName: PSRule.Rules.Kubernetes + downloadPath: $(Build.SourcesDirectory)/out/modules/PSRule.Rules.Kubernetes + # Install pipeline dependencies and build module + - powershell: ./scripts/pipeline-build.ps1 -File ./pipeline.build.ps1 -Task Release -NuGetApiKey $(apiKey) + displayName: 'Publish module' diff --git a/CHANGELOG.md b/CHANGELOG.md index 0129cea..7027c71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## Unreleased -## v0.1.0-B190521 +## v0.1.0-B190521 (pre-release) - Initial pre-release