forked from Dejulia489/ZabbixPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
58 lines (54 loc) · 1.52 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Powershell Module Pipeline
# Module version
name: 0.1.$(rev:r)
# Build variables
variables:
PSGALLERY_APIKEY: $(PSGalleryApiKey)
MODULE_NAME: ZabbixPS
resources:
- repo: self
pool:
vmImage: 'windows-latest'
trigger:
paths:
exclude:
- README.md
stages:
- stage:
displayName: Build
jobs:
- job:
displayName: Build
steps:
- powershell: ./build.ps1
displayName: 'Build Module'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: Output
ArtifactName: Artifacts
- task: PublishTestResults@2
displayName: 'Publish Test Results **\TestResults*.xml'
inputs:
testResultsFormat: NUnit
testResultsFiles: '**\TestResults*.xml'
mergeTestResults: true
testRunTitle: '$(Build.BuildNumber)'
- stage:
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Prod
jobs:
- deployment:
displayName: Marketplace
environment: Marketplace
strategy:
runOnce:
deploy:
steps:
- task: PowerShell@2
displayName: Publish Module to PSGallery
inputs:
targetType: 'inline'
script: |
dir env:
Publish-Module -Path "$(AGENT.BUILDDIRECTORY)\Artifacts\$(MODULE_NAME)" -Repository 'PSGallery' -NuGetApiKey '$(PSGALLERY_APIKEY)'