Update pipeline to used multiple stages (#11)

This commit is contained in:
Bernie White 2019-05-20 23:41:10 +10:00 коммит произвёл GitHub
Родитель 6f4909cecf
Коммит e380669f67
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 111 добавлений и 1 удалений

Просмотреть файл

@ -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'

Просмотреть файл

@ -1,6 +1,6 @@
## Unreleased
## v0.1.0-B190521
## v0.1.0-B190521 (pre-release)
- Initial pre-release