/
mainframe_ispw.yaml
146 lines (134 loc) · 5.82 KB
/
mainframe_ispw.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
135
136
137
138
139
140
141
142
143
144
145
146
trigger: none
pool:
name: 'Default'
variables:
- group: 'mainframe-pipeline-parameters'
- name: 'gitRepo'
value: 'FTSDEMO_$(ispwApplication)_Unit_Tests'
- name: 'ccSystem'
value: 'AZURE_$(ispwContainerName)'
- name: 'ccDdio'
value: 'SALESSUP.$(ispwApplication).$(ispwLevel).LOAD.SSD'
- name: 'sonarProjectName'
value: 'RNU_$(ispwApplication)_Azure'
- name: 'sonarSources'
value: '.\$(ispwApplication)\MF_Source'
stages:
- stage: preparation
displayName: Preparation
jobs:
- job: getAssets
displayName: Get Assets from Mainframe and GitHub
steps:
# After promote ISPW passes the DEV level name, we need the QA level name, though
# Determine QA level name from DEV level name and create a new pipeline variable
- task: PowerShell@2
displayName: Determine ISPW Target Level
name: setTargetLevel
inputs:
targetType: 'inline'
script: |
$ispwTargetLevel = 'QA' + '$(ispwLevel)'.Substring('$(ispwLevel)'.Length - 1, 1)
Write-Host 'Determined Level ' $ispwTargetLevel
echo "##vso[task.setvariable variable=ispwTargetLevel]$ispwTargetLevel"
# Execute Powershell Script to clear Workspace
- task: PowerShell@2
displayName: Clear Workspace
inputs:
filePath: '$(agentScriptsPath)\Clear_Workspace.ps1'
arguments: '$(workspaceRoot)'
# Execute Powershell Script to download sources from ISPW
- task: PowerShell@2
displayName: Download sources for assignment
inputs:
filePath: '$(agentScriptsPath)\ISPW_Download_Container.ps1'
arguments: '$(workspaceRoot) $(hostUri) $(hostPort) $(hostUser) $(hostPassword) $(hostCodePage) $(ispwConfig) $(ispwContainerName) $(ispwContainerType) $(ispwTargetLevel) $(cliPath)'
# Execute Powershell Script to clone TTT Assets from GitHub repo
- task: PowerShell@2
displayName: Get Unit Tests
inputs:
filePath: '$(agentScriptsPath)\Git_Clone_TTT_Repo.ps1'
arguments: '$(workspaceRoot) $(gitProject)/$(gitRepo)'
- stage: tests
displayName: Tests
jobs:
- job: runTests
displayName: Run unit tests and get results
steps:
# Execute Powershell Script to run unit tests
- task: PowerShell@2
displayName: Execute Unit Tests
inputs:
filePath: '$(agentScriptsPath)\TTT_Run_Tests.ps1'
arguments: '$(workspaceRoot) $(hostUri) $(hostPort) $(hostUser) $(hostPassword) $(hostCodePage) $(ispwApplication) $(ispwLevel) $(ccRepo) $(ccSystem) $(ccTestId) $(cliPath)'
# Execute Powershell Script to download Code Coverage results
- task: PowerShell@2
displayName: Get Code Coverage Results
inputs:
filePath: '$(agentScriptsPath)\Code_Coverage_Download_Metrics.ps1'
arguments: '$(workspaceRoot) $(hostUri) $(hostPort) $(hostUser) $(hostPassword) $(hostCodePage) $(ispwApplication) $(ccRepo) $(ccSystem) $(ccTestId) $(ccDdio) $(cliPath)'
- stage: qualityGate
displayName: Quality Gate
jobs:
- job: sonar
displayName: run Sonar Scan, Check Quality Gate
steps:
# Execute Powershell Script to run Sonar Scanner
- task: PowerShell@2
displayName: Run Sonar Scanner
inputs:
filePath: '$(agentScriptsPath)\Sonar_Scan.ps1'
arguments: '$(workspaceRoot) $(ispwApplication) $(sonarProjectName) $(sonarSources)'
- job: checkQualityGate
displayName: Check Quality Gate
dependsOn: sonar
steps:
# Execute Powershell Script to check Sonar Quality Gate
- task: PowerShell@2
displayName: Check Sonar Quality Gate
inputs:
filePath: '$(agentScriptsPath)\Sonar_Check_Quality_Gate.ps1'
arguments: '$(sonarServer) $(sonarProjectName) $(sonarAuthorization)'
- job: triggerRelease
displayName: Trigger Release Pipeline
dependsOn:
- checkQualityGate
condition: succeeded('checkQualityGate')
steps:
# After promote ISPW passes the DEV level name, we need the QA level name, though
# Determine QA level name from DEV level name and create a new pipeline variable
- task: PowerShell@2
name: setTargetLevel
displayName: Determine ISPW Target Level
inputs:
targetType: 'inline'
script: |
$ispwTargetLevel = 'QA' + '$(ispwLevel)'.Substring('$(ispwLevel)'.Length - 1, 1)
Write-Host 'Determined Level ' $ispwTargetLevel
echo "##vso[task.setvariable variable=ispwTargetLevel]$ispwTargetLevel"
- task: PowerShell@2
displayName: Trigger Release
inputs:
filePath: '$(agentScriptsPath)\Azure_Trigger_Release.ps1'
arguments: '$(azureRestAddress) $(azureOrganization) $(System.TeamProject) "$(azureRestAuthorization)" $(ispwApplication) $(ispwContainerName) $(ispwContainerType) $(ispwTargetLevel) $(releaseDefinitionId)'
- job: regressAssignment
dependsOn:
- checkQualityGate
condition: failed('checkQualityGate')
steps:
# After promote ISPW passes the DEV level name, we need the QA level name, though
# Determine QA level name from DEV level name and create a new pipeline variable
- task: PowerShell@2
displayName: Determine ISPW Target Level
name: setTargetLevel
inputs:
targetType: 'inline'
script: |
$ispwTargetLevel = 'QA' + '$(ispwLevel)'.Substring('$(ispwLevel)'.Length - 1, 1)
Write-Host 'Determined Level ' $ispwTargetLevel
echo "##vso[task.setvariable variable=ispwTargetLevel]$ispwTargetLevel"
- task: PowerShell@2
displayName: Regress Assignment
inputs:
filePath: '$(agentScriptsPath)\ISPW_Operations.ps1'
arguments: 'ContainerOperation $(cesUri) $(ispwConfig) assignments regress $(ispwContainerName) $(ispwTargetLevel) $(cesToken) FTSDEMO $(ispwApplication) $(ispwServer)'