-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
120 lines (116 loc) · 2.99 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
trigger:
- main
pr:
- main
variables:
- name: PublisherId
value: "BoostSecurity"
- name: ServiceName
value: "boostsec-azure-pipeline-publisher"
- name: isMain
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
stages:
- stage: Test
jobs:
- job:
steps:
- template: stages/test.yaml
- stage: PackageDev
condition: eq(variables.isMain, 'false')
dependsOn: Test
variables:
- name: ExtensionId
value: "BoostSecurityScanDev"
- name: ExtensionName
value: "BoostSecurity Scanner Dev"
- name: ExtensionVisibility
value: "private"
- name: ManifestFile
value: "vss-extension.dev.json"
jobs:
- job:
steps:
- template: stages/package.yaml
- stage: PublishDev
dependsOn: PackageDev
variables:
- name: ExtensionId
value: "BoostSecurityScanDev"
- name: ExtensionName
value: "BoostSecurity Scanner Dev"
- name: ExtensionVisibility
value: "private"
jobs:
- job:
steps:
- template: stages/publish.yaml
- task: Bash@3
displayName: Sleep 120
inputs:
targetType: "inline"
script: |
# add a delay waiting for the extension to propagate
sleep 120
- stage: ValidateDev
dependsOn: PublishDev
variables:
- group: boost-prod
- name: api_token
value: $[variables.BOOST_API_TOKEN]
jobs:
- job:
steps:
- checkout: self
clean: "true"
fetchDepth: "1"
persistCredentials: "true"
- task: BoostSecurityScanDev@1
inputs:
apiToken: $(api_token)
registryModule: boostsecurityio/scanner
- stage: PackageProd
condition: eq(variables.isMain, 'true')
dependsOn: Test
variables:
- name: ExtensionId
value: "BoostSecurityScan"
- name: ExtensionName
value: "BoostSecurity Scanner"
- name: ExtensionVisibility
value: "public"
- name: ManifestFile
value: "vss-extension.json"
jobs:
- job:
steps:
- template: stages/package.yaml
- stage: PublishProd
dependsOn: PackageProd
variables:
- name: ExtensionId
value: "BoostSecurityScan"
- name: ExtensionName
value: "BoostSecurity Scanner"
- name: ExtensionVisibility
value: "public"
jobs:
- job:
steps:
- template: stages/publish.yaml
- stage: ValidateProd
dependsOn: PublishProd
variables:
- group: boost-prod
- name: api_token
value: $[variables.BOOST_API_TOKEN]
jobs:
- job:
steps:
- checkout: self
clean: "true"
fetchDepth: "1"
persistCredentials: "true"
- task: BoostSecurityScan@1
inputs:
apiToken: $(api_token)
registryModule: boostsecurityio/scanner