forked from szbra/toolchain-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
catalog-api.pipeline.yml
252 lines (252 loc) · 6.56 KB
/
catalog-api.pipeline.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
---
stages:
- name: BUILD
inputs:
- type: git
branch: master
url: ${GIT_REPO_URL}
token: ${GIT_REPO_TOKEN}
triggers:
- type: commit
jobs:
- name: Build
type: builder
- name: Unit Test
type: tester
extension_id: ibm.devops.services.pipeline.dra_mocha_test
target:
region_id: ${DEV_REGION_ID}
organization: ${DEV_ORG_NAME}
space: ${DEV_SPACE_NAME}
MINIMUM_SUCCESS_RATE: '100'
TEST_LOG_FILE: tests/server/mochatest.json
MINIMUM_COVERAGE_RATE: '50'
ADVISORY_MODE: 'false'
COVERAGE_TOOL_SELECT: istanbul
COVERAGE_REGRESSION_THRESHOLD: '2'
CHECK_TEST_REGRESSION: 'true'
COVERAGE_LOG_FILE: tests/server/coverage/reports/coverage-summary.json
COMMAND: |
#!/bin/bash
npm install
grunt dev-test-cov --no-color -f
CHECK_COVERAGE_REGRESSION: 'true'
TEST_TOOL_SELECT: mocha
- name: DEV
inputs:
- type: job
stage: BUILD
job: Build
triggers:
- type: stage
properties:
- name: CF_APP_NAME
value: undefined
type: text
- name: APP_URL
value: undefined
type: text
jobs:
- name: Set App name
type: deployer
target:
region_id: ${DEV_REGION_ID}
organization: ${DEV_ORG_NAME}
space: ${DEV_SPACE_NAME}
application: ${CF_APP_NAME}
script: |-
#!/bin/bash
export CF_APP_NAME="dev-$CF_APP"
- name: Pre Deploy
type: deployer
extension_id: ibm.devops.services.pipeline.dra_deploy_extn
target:
region_id: ${DEV_REGION_ID}
organization: ${DEV_ORG_NAME}
space: ${DEV_SPACE_NAME}
application: ${CF_APP_NAME}
ENABLE_COMPARE_APPS: 'false'
DRA_MODE: 'false'
APPLICATION_NAME: ${CF_APP_NAME}
APP_DESTINATION: Alpha
ENABLE_BOUND_SERVICE: 'true'
APP_NOTDESTINATION: Test
COMMAND: '#!/bin/bash'
- name: Deploy to Dev
type: deployer
target:
region_id: ${DEV_REGION_ID}
organization: ${DEV_ORG_NAME}
space: ${DEV_SPACE_NAME}
application: ${CF_APP_NAME}
script: |
#!/bin/bash
cf create-service cloudantNoSQLDB Shared myMicroservicesCloudant
# Push app
cf push "${CF_APP_NAME}"
export APP_URL=http://$(cf app $CF_APP_NAME | grep urls: | awk '{print $2}')
# View logs
#cf logs "${CF_APP_NAME}" --recent
- name: Functional Test
type: tester
extension_id: ibm.devops.services.pipeline.dra_mocha_fvt
target:
region_id: ${QA_REGION_ID}
organization: ${DEV_ORG_NAME}
space: ${DEV_SPACE_NAME}
application: ${CF_APP_NAME}
MINIMUM_SUCCESS_RATE: '100'
TEST_LOG_FILE: tests/fvt/mochafvttest.json
ADVISORY_MODE: 'false'
CHECK_TEST_REGRESSION: 'true'
COMMAND: |-
#!/bin/bash
export CATALOG_API_TEST_SERVER=$APP_URL
npm install
grunt dev-fvt --no-color -f
TEST_TOOL_SELECT: mocha
- name: TEST
inputs:
- type: job
stage: BUILD
job: Build
triggers:
- type: stage
properties:
- name: CF_APP_NAME
value: undefined
type: text
- name: APP_URL
value: undefined
type: text
jobs:
- name: Set App name
type: deployer
target:
region_id: ${QA_REGION_ID}
organization: ${QA_ORG_NAME}
space: ${QA_SPACE_NAME}
application: ${CF_APP_NAME}
script: |-
#!/bin/bash
export CF_APP_NAME="test-$CF_APP"
- name: Pre Deploy
type: deployer
extension_id: ibm.devops.services.pipeline.dra_deploy_extn
target:
region_id: ${QA_REGION_ID}
organization: ${QA_ORG_NAME}
space: ${QA_SPACE_NAME}
application: ${CF_APP_NAME}
ENABLE_COMPARE_APPS: 'true'
DRA_MODE: 'false'
APPLICATION_NAME: ${CF_APP_NAME}
APP_DESTINATION: Test
ENABLE_BOUND_SERVICE: 'true'
APP_NOTDESTINATION: Alpha
COMMAND: '#!/bin/bash'
- name: Deploy to Test
type: deployer
target:
region_id: ${QA_REGION_ID}
organization: ${QA_ORG_NAME}
space: ${QA_SPACE_NAME}
application: ${CF_APP_NAME}
script: |
#!/bin/bash
cf create-service cloudantNoSQLDB Shared myMicroservicesCloudant
# Push app
cf push "${CF_APP_NAME}"
# View logs
#cf logs "${CF_APP_NAME}" --recent
- name: PROD
inputs:
- type: job
stage: BUILD
job: Build
triggers:
- type: stage
properties:
- name: CF_APP_NAME
value: undefined
type: text
- name: APP_URL
value: undefined
type: text
- name: ROUTE_DOMAIN
value: stage1.mybluemix.net
type: text
- name: GROUP_SIZE
value: '3'
type: text
- name: TARGET_PLATFORM
value: CloudFoundry
type: text
- name: TEST_RESULT_FOR_AD
value: ''
type: text
jobs:
- name: Set App name
type: deployer
target:
region_id: ${PROD_REGION_ID}
organization: ${PROD_ORG_NAME}
space: ${PROD_SPACE_NAME}
application: ${CF_APP_NAME}
script: |-
#!/bin/bash
export CF_APP_NAME="${CF_APP}_${BUILD_NUMBER}"
- name: Pre Deploy
type: deployer
extension_id: ibm.devops.services.pipeline.dra_deploy_extn
target:
region_id: ${PROD_REGION_ID}
organization: ${PROD_ORG_NAME}
space: ${PROD_SPACE_NAME}
application: ${CF_APP_NAME}
ENABLE_COMPARE_APPS: 'false'
DRA_MODE: 'false'
APPLICATION_NAME: ${CF_APP_NAME}
APP_DESTINATION: Prod
ENABLE_BOUND_SERVICE: 'false'
APP_NOTDESTINATION: Test
COMMAND: '#!/bin/bash'
- name: Deploy Single Instance
type: deployer
target:
region_id: ${PROD_REGION_ID}
organization: ${PROD_ORG_NAME}
space: ${PROD_SPACE_NAME}
application: ${CF_APP_NAME}
script: |-
#!/bin/bash
cf create-service cloudantNoSQLDB Shared myMicroservicesCloudant
cf push "${CF_APP_NAME}" --no-route -i 1
- name: Begin AD
type: deployer
extension_id: ibm.devops.services.pipeline.devops.ad_start
target:
region_id: ${PROD_REGION_ID}
organization: ${PROD_ORG_NAME}
space: ${PROD_SPACE_NAME}
application: ${CF_APP_NAME}
RAMPDOWN_DURATION: 1m
RAMPUP_DURATION: 1m
COMMAND: |-
#!/bin/bash
source ${EXT_DIR}/git_util.sh
git_retry clone https://github.com/Osthanes/update_service.git activedeploy
activedeploy/activedeploy_step_1.sh
- name: Complete AD
type: deployer
extension_id: ibm.devops.services.pipeline.devops.ad_finish
target:
region_id: ${PROD_REGION_ID}
organization: ${PROD_ORG_NAME}
space: ${PROD_SPACE_NAME}
application: ${CF_APP_NAME}
COMMAND: |-
#!/bin/bash
source ${EXT_DIR}/git_util.sh
git_retry clone https://github.com/Osthanes/update_service.git activedeploy
activedeploy/activedeploy_step_2.sh