-
Notifications
You must be signed in to change notification settings - Fork 19
/
azure-pipelines.yml
128 lines (113 loc) · 4.11 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
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
# Pulumi Azure Pipelines task extension
# Run tests and create a new artifact
# to be published in the Visual Studio Marketplace
# under the pulumi publisher ID.
trigger:
- master
stages:
- stage: build
displayName: "Build and test"
jobs:
- job: build
pool:
vmImage: "ubuntu-latest"
steps:
- task: NodeTool@0
inputs:
versionSpec: "16.x"
displayName: "Install Node.js"
- task: Npm@1
displayName: "Restore node_modules for buildAndReleaseTask/"
inputs:
workingDir: buildAndReleaseTask/
verbose: true
- task: Npm@1
displayName: "Restore node_modules for buildAndReleaseTask/tests/"
inputs:
workingDir: buildAndReleaseTask/tests
verbose: true
- task: Npm@1
displayName: "Run lints"
inputs:
command: "custom"
customCommand: run lint
- task: Npm@1
displayName: "Run unit tests"
inputs:
command: "custom"
customCommand: run test
env:
INPUT_AZURESUBSCRIPTION: "fake-subscription-id"
- stage: package
condition: or(
eq(variables['Build.Reason'], 'IndividualCI'),
eq(variables['Build.Reason'], 'BatchedCI'),
eq(variables['ManualOverride'], 'true')
)
displayName: "Publish test extension"
jobs:
- job: testTfxCreate
displayName: "Create and publish test extension"
pool:
vmImage: "ubuntu-latest"
steps:
- task: Npm@1
displayName: "Restore node_modules for buildAndReleaseTask/"
inputs:
workingDir: buildAndReleaseTask/
verbose: true
- task: Npm@1
displayName: "Compile TS to JS"
inputs:
workingDir: buildAndReleaseTask/
command: "custom"
customCommand: run tsc
- task: TfxInstaller@2
inputs:
version: "v0.16.x"
- task: CmdLine@2
displayName: "Update task name"
inputs:
script: 'sed -i ''s/"Pulumi"/"Test Pulumi"/g'' task.json'
workingDirectory: "./buildAndReleaseTask/"
failOnStderr: true
- task: CmdLine@2
displayName: "Update task id"
inputs:
script: 'sed -i ''s/"66148448-e174-4167-91a4-0ac63f4a10ca"/"f7c2cffd-7ad2-4db6-b699-205f9e99837c"/g'' task.json'
workingDirectory: "./buildAndReleaseTask/"
failOnStderr: true
- task: QueryAzureDevOpsExtensionVersion@2
inputs:
connectTo: "VsTeam"
connectedServiceName: "Pulumi Marketplace"
publisherId: "pulumi"
extensionId: "build-and-release-task"
versionAction: "Patch"
outputVariable: "TestExtension.Version"
extensionVersionOverride: "TestExtension.VersionOverride"
- task: PackageAzureDevOpsExtension@3
inputs:
outputVariable: "TestExtension.OutputPath"
publisherId: "pulumi"
extensionId: "test-build-and-release-task"
extensionName: "(Test) Pulumi Azure Pipelines Task"
extensionVersion: "$(TestExtension.Version).$(Build.BuildId)"
updateTasksVersion: true
extensionVisibility: "private"
extensionPricing: "free"
- task: PublishAzureDevOpsExtension@3
displayName: "Publish Extension"
inputs:
connectTo: "VsTeam"
connectedServiceName: "Pulumi Marketplace"
fileType: "vsix"
vsixFile: "$(TestExtension.OutputPath)"
publisherId: "pulumi"
updateTasksVersion: false
- task: PublishPipelineArtifact@1
displayName: "Create pipeline artifact"
inputs:
targetPath: "$(TestExtension.OutputPath)"
artifact: "testvsix"
publishLocation: "pipeline"