-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yaml
111 lines (105 loc) · 3.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
trigger:
branches:
include:
- "*"
variables:
DEVOPS_ORGANISATION: "bowdata"
DEVOPS_DOMAIN: "dev.azure.com"
parameters:
## Ignore Parameter Set
- name: _ignore_params
type: object
default: []
## General Parameter Set
- name: _general_params
type: object
default:
- workingDirectory
- logLevel
- name: workingDirectory
default: $(Build.SourcesDirectory)
- name: logLevel
default: INFO
type: string
values:
- INFO
- DEBUG
- WARNING
- ERROR
- CRITICAL
## Lint Stage Parameter Set
- name: _lint_stage_params
type: object
default:
- lintStageName
- lintStageDisplayName
- lintStageDependsOn
- lintStageCondition
- lintStageVariables
- name: lintStageName
default: Lint
- name: lintStageDisplayName
default: 'Lint Stage'
- name: lintStageDependsOn
default: ""
- name: lintStageCondition
default: succeeded()
- name: lintStageVariables
type: object
default: {}
## Test Stage Parameter Set
- name: _test_stage_params
type: object
default:
- testStageName
- testStageDisplayName
- testStageDependsOn
- testStageCondition
- testStageVariables
- name: testStageName
default: Test
- name: testStageDisplayName
default: 'Test Stage'
- name: testStageDependsOn
default: 'Lint'
- name: testStageCondition
default: succeeded()
- name: testStageVariables
type: object
default: {}
## Build Stage Parameter Set
- name: _build_stage_params
type: object
default:
- buildStageName
- buildStageDisplayName
- buildStageDependsOn
- buildStageCondition
- buildStageVariables
- name: buildStageName
default: Build
- name: buildStageDisplayName
default: 'Build Stage'
- name: buildStageDependsOn
default: 'Test'
- name: buildStageCondition
default: and(succeeded(), or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), contains(variables['Build.SourceBranch'], 'refs/tags/')))
- name: buildStageVariables
type: object
default: { }
stages:
- template: /templates/stages/lint-stage.yaml
parameters:
${{ each pair in parameters }}:
${{if and(or(containsValue(parameters._lint_stage_params, pair.key), containsValue(parameters._general_params, pair.key)), not(containsValue(parameters._ignore_params, pair.key)))}}:
${{pair.key}}: ${{pair.value}}
- template: /templates/stages/test-stage.yaml
parameters:
${{ each pair in parameters }}:
${{if and(or(containsValue(parameters._test_stage_params, pair.key), containsValue(parameters._general_params, pair.key)), not(containsValue(parameters._ignore_params, pair.key)))}}:
${{pair.key}}: ${{pair.value}}
- template: /templates/stages/build-stage.yaml
parameters:
${{ each pair in parameters }}:
${{if and(or(containsValue(parameters._build_stage_params, pair.key), containsValue(parameters._general_params, pair.key)), not(containsValue(parameters._ignore_params, pair.key)))}}:
${{pair.key}}: ${{pair.value}}