forked from vmware-archive/concourse-pipeline-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.yml
244 lines (231 loc) · 7.38 KB
/
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
groups:
- name: Install-PKS
jobs:
- upload-product
- stage-product
- update-director-config
- configure-product
- deploy-product
- create-pks-cli-user
- name: Delete-PKS-Clusters
jobs:
- delete-clusters
- delete-product
resources:
- name: pcf-pipelines-utils
type: git
source:
uri: https://github.com/pivotalservices/concourse-pipeline-samples.git
- name: product-release
type: pivnet
source:
api_token: {{pivnet_token}}
product_slug: pivotal-container-service
product_version: {{product_version}}
sort_by: semver
# release_type: "Release Candidate"
resource_types:
- name: pivnet
type: docker-image
source:
repository: pivotalcf/pivnet-resource
tag: latest-final
jobs:
- name: upload-product
plan:
- aggregate:
- get: pcf-pipelines-utils
- get: pivnet-product
resource: product-release
params:
globs:
- "*.pivotal"
- task: upload-tile
file: pcf-pipelines-utils/tasks/pcf/upload-product-and-stemcell/task.yml
input_mapping:
pcf-pipelines: pcf-pipelines-utils
params:
IAAS: {{iaas_type}}
NO_PROXY: {{company_proxy_domain}}
OM_IP: {{opsman_ip_address}}
OPS_MGR_PWD: {{opsman_admin_password}}
OPS_MGR_USR: {{opsman_admin_username}}
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
PIVNET_API_TOKEN: {{pivnet_token}}
- name: stage-product
plan:
- aggregate:
- get: pcf-pipelines-utils
- get: pivnet-product
passed:
- upload-product
trigger: true
resource: product-release
params:
globs: ["*.pivotal"]
- task: stage
file: pcf-pipelines-utils/tasks/pcf/stage-product/task.yml
input_mapping:
pcf-pipelines: pcf-pipelines-utils
params:
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_USERNAME: {{opsman_admin_username}}
- name: update-director-config
plan:
- get: pivnet-product
passed:
- stage-product
resource: product-release
trigger: true
params:
globs: []
- get: pcf-pipelines-utils
- task: enable-director-post-deploy-tasks
config:
platform: linux
image_resource:
type: docker-image
source:
repository: czero/rootfs
inputs:
- name: pcf-pipelines-utils
run:
path: bash
args:
- -ec
- |
echo "For PKS 1.0.0:"
echo "CFCR release has a post deploy errand that deploys kube-dns, heapster, the dashboard and influxdb addons."
echo "You need to have the Bosh Director's post deploy errands turned on, otherwise none of that gets installed when you create a cluster."
echo "This issue may be addressed as an errand for the PKS tile."
echo "Thus, in the meantime, this task enables the Post Deploy tasks for the Director tile."
director_config=$(cat <<-EOF
{
"post_deploy_enabled": true
}
EOF
)
echo "Configuring Director..."
om-linux \
--target https://$OPSMAN_DOMAIN_OR_IP_ADDRESS \
--skip-ssl-validation \
--client-id "${OPSMAN_CLIENT_ID}" \
--client-secret "${OPSMAN_CLIENT_SECRET}" \
--username "$OPSMAN_USERNAME" \
--password "$OPSMAN_PASSWORD" \
configure-bosh \
--director-configuration "$director_config"
params:
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_USERNAME: {{opsman_admin_username}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
- name: configure-product
plan:
- aggregate:
- get: pcf-pipelines-utils
- get: pivnet-product
passed:
- update-director-config
resource: product-release
trigger: true
params:
globs: []
- task: configure-tile
file: pcf-pipelines-utils/tasks/pcf/configure-tile/task.yml
params:
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_USERNAME: {{opsman_admin_username}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
TILE_PROPERTIES: {{properties}}
TILE_NETWORK: {{networks}}
TILE_RESOURCES: {{resources}}
TILE_PRODUCT_NAME: {{product_name}}
- task: disable-errands
file: pcf-pipelines-utils/tasks/pcf/disable-errands/task.yml
input_mapping:
pcf-pipelines: pcf-pipelines-utils
params:
ERRANDS_TO_DISABLE: {{errands_to_disable}}
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_USERNAME: {{opsman_admin_username}}
PRODUCT_NAME: {{product_name}}
- name: deploy-product
plan:
- aggregate:
- get: pcf-pipelines-utils
- get: pivnet-product
passed:
- configure-product
resource: product-release
trigger: true
params:
globs: []
- task: apply-changes
file: pcf-pipelines-utils/tasks/pcf/apply-changes/task.yml
params:
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_USERNAME: {{opsman_admin_username}}
- name: create-pks-cli-user
plan:
- aggregate:
- get: pcf-pipelines-utils
- task: configure-pks-cli-user
file: pcf-pipelines-utils/tasks/pcf/pks/configure-pks-cli-user/task.yml
params:
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_USERNAME: {{opsman_admin_username}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
PKS_API_DOMAIN: {{pcf_pks_api_domain}}
PKS_CLI_USERNAME: {{pks_cli_username}}
PKS_CLI_USEREMAIL: {{pks_cli_useremail}}
PKS_CLI_PASSWORD: {{pks_cli_password}}
- name: delete-clusters
plan:
- get: pcf-pipelines-utils
- task: delete-all-pks-clusters
file: pcf-pipelines-utils/tasks/pcf/pks/delete-all-pks-clusters/task.yml
params:
PCF_PKS_API: ((pcf_pks_api_domain))
PKS_CLI_USERNAME: {{pks_cli_username}}
PKS_CLI_PASSWORD: {{pks_cli_password}}
DEBUG: false
- name: delete-product
plan:
- get: pcf-pipelines-utils
passed:
- delete-clusters
trigger: true
- task: delete-product
file: pcf-pipelines-utils/tasks/pcf/delete-tile/task.yml
params:
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_USERNAME: {{opsman_admin_username}}
TILE_PRODUCT_NAME: {{product_name}}
- task: apply-changes
file: pcf-pipelines-utils/tasks/pcf/apply-changes/task.yml
params:
OPSMAN_CLIENT_ID: {{opsman_client_id}}
OPSMAN_CLIENT_SECRET: {{opsman_client_secret}}
OPSMAN_DOMAIN_OR_IP_ADDRESS: {{opsman_domain}}
OPSMAN_PASSWORD: {{opsman_admin_password}}
OPSMAN_USERNAME: {{opsman_admin_username}}