-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathazure-pipelines.yml
141 lines (127 loc) · 3.95 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
129
130
131
132
133
134
135
136
137
138
139
140
141
name: '2.0$(rev:.r)'
trigger:
- main
- feature/*
- features/*
- bugfix/*
pool:
vmImage: 'ubuntu-latest'
variables:
system.debug: true
stages:
- stage: 'Build'
displayName: 'Build'
jobs:
- job:
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
- task: SonarCloudPrepare@3
inputs:
SonarCloud: 'SonarCloud'
organization: 'joostvoskuil'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'JoostVoskuil_azure-devops-gitleaks'
cliProjectName: 'JoostVoskuil_azure-devops-gitleaks'
cliSources: '.'
extraProperties: |
sonar.coverage.exclusions=task/v2/test/*.ts,task/v3/test/*.ts
sonar.cpd.exclusions=task/v2/test/*.ts,task/v3/test/*.ts
- template: build-and-test.yml
parameters:
path: task/v2
name: Gitleaks V2
- template: build-and-test.yml
parameters:
path: task/v3
name: Gitleaks V3
- task: SonarCloudAnalyze@3
inputs:
jdkversion: 'JAVA_HOME_17_X64'
- task: SonarCloudPublish@3
inputs:
pollingTimeoutSec: '300'
- task: TfxInstaller@4
displayName: 'Use Node CLI for Azure DevOps'
inputs:
version: '0.x'
checkLatest: true
- task: PackageAzureDevOpsExtension@4
displayName: 'Package Extension: $(Build.SourcesDirectory)'
name: 'packageStep'
inputs:
rootFolder: '$(Build.SourcesDirectory)'
outputPath: '$(Build.ArtifactStagingDirectory)/foxholenl-gitleaks.vsix'
publisherId: 'foxholenl'
extensionId: 'Gitleaks'
extensionName: 'Gitleaks'
extensionTag: '-build'
extensionVersion: '$(Build.BuildNumber)'
extensionVisibility: private
- task: PublishPipelineArtifact@1
displayName: 'Publish vsix'
inputs:
publishLocation: pipeline
targetPath: '$(packageStep.Extension.OutputPath)'
artifact: 'vsix'
condition: succeededOrFailed()
- stage: Test
displayName: 'Publish to Marketplace (private)'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
dependsOn: 'Build'
jobs:
- deployment:
environment: Test
strategy:
runOnce:
deploy:
steps:
- task: TfxInstaller@4
displayName: 'Use Node CLI for Azure DevOps'
inputs:
version: '0.x'
checkLatest: true
- task: PublishAzureDevOpsExtension@4
name: 'PublishTest'
inputs:
connectTo: 'VsTeam'
connectedServiceName: 'Marketplace'
fileType: 'vsix'
vsixFile: '$(Pipeline.Workspace)/vsix/foxholenl-gitleaks.vsix'
publisherId: 'foxholenl'
extensionTag: '-dev'
updateTasksVersion: false
extensionVisibility: 'privatepreview'
shareWith: 'foxholenl'
noWaitValidation: true
- stage: Production
displayName: 'Publish to Marketplace (Public)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
dependsOn: 'Test'
jobs:
- deployment:
environment: Production
strategy:
runOnce:
deploy:
steps:
- task: TfxInstaller@4
displayName: 'Use Node CLI for Azure DevOps'
inputs:
version: '0.x'
checkLatest: true
- task: PublishAzureDevOpsExtension@4
name: 'PublishProd'
inputs:
connectTo: 'VsTeam'
connectedServiceName: 'Marketplace'
fileType: 'vsix'
vsixFile: '$(Pipeline.Workspace)/vsix/foxholenl-gitleaks.vsix'
publisherId: 'foxholenl'
extensionId: 'Gitleaks'
updateTasksVersion: false
extensionVisibility: 'public'
noWaitValidation: true