-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yaml
137 lines (115 loc) · 4.13 KB
/
azure-pipelines.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: 3.0$(Rev:.r)
# Define variables
variables:
shareAccounts: turtlesystems, chefcorp-partnerengineering
connectedServiceName: AzDo Publish Extension - Progress
stages:
- stage: build
displayName: "Build:"
jobs:
# Create a job that installs the NPM modules, performs the linting tests and
# creates the extension package
- job: setup_and_build
displayName: Setup & Build
pool:
vmImage: ubuntu-latest
steps:
# Install all the dependent NPM modules as required by the tasks
- task: Npm@1
displayName: 'Install NPM Modules'
inputs:
verbose: $(System.Debug)
# Build the extension
- task: Npm@1
displayName: 'Build Extension'
inputs:
command: custom
customCommand: 'run all'
verbose: $(System.Debug)
# Validate the vsix file of the extension
# This is done here before attempting to publish as it is too late then
- task: Npm@1
displayName: 'Validate Extension'
inputs:
command: custom
customCommand: run validate -- $(build.sourcesdirectory)/build/chef-software.chef-preview-$(Build.BuildNumber).vsix
verbose: $(System.Debug)
# Upload tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'junit.xml'
searchFolder: '$(build.sourcesdirectory)/build/tests'
# Upload coverage
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(build.sourcesdirectory)/build/tests/coverage/cobertura-coverage.xml'
reportDirectory: '$(build.sourcesdirectory)/build/tests/coverage'
# Copy the build artifacts to the staging directory
- task: CopyFiles@2
displayName: 'Copy Preview Files to: Artefact Directory'
inputs:
SourceFolder: '$(build.sourcesdirectory)/build'
Contents: 'chef-software.chef-azdo-preview-$(Build.BuildNumber).vsix'
TargetFolder: '$(build.artifactstagingdirectory)/preview'
- task: CopyFiles@2
displayName: 'Copy Production Files to: Artefact Directory'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/build'
Contents: 'chef-software.chef-azdo-$(Build.BuildNumber).vsix'
TargetFolder: '$(build.artifactstagingdirectory)/production'
- task: PublishPipelineArtifact@1
displayName: Publish Extension packages
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: build
- stage: preview
displayName: Preview
dependsOn: build
jobs:
- deployment: azdo_extension_preview
displayName: Publish Preview Extension
pool:
vmImage: ubuntu-latest
environment: 'Preview'
strategy:
runOnce:
deploy:
steps:
- task: ms-devlabs.vsts-developer-tools-build-tasks.tfx-installer-build-task.TfxInstaller@3
displayName: 'Install tfx-cli'
- task: PublishAzureDevopsExtension@3
displayName: Publish
inputs:
connectedServiceName: $(connectedServiceName)
fileType: vsix
vsixFile: $(Pipeline.Workspace)/build/preview/*.vsix
- task: ShareAzureDevopsExtension@3
displayName: Share
inputs:
connectedServiceName: $(connectedServiceName)
method: vsix
vsixFile: $(Pipeline.Workspace)/build/preview/*.vsix
accounts: $(shareAccounts)
- stage: production
displayName: Production
dependsOn: build
jobs:
- deployment: azdo_extension_release
displayName: Publish Release Extension
pool:
vmImage: ubuntu-latest
environment: 'Release'
strategy:
runOnce:
deploy:
steps:
- task: ms-devlabs.vsts-developer-tools-build-tasks.tfx-installer-build-task.TfxInstaller@3
displayName: 'Install tfx-cli'
- task: PublishAzureDevopsExtension@3
displayName: Publish
inputs:
connectedServiceName: $(connectedServiceName)
fileType: vsix
vsixFile: $(Pipeline.Workspace)/build/production/*.vsix