This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
/
pipeline.yml
195 lines (181 loc) · 5.48 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
resources:
- name: pcf-ops-manager
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "ops-manager/ops-manager-(.*).tar"
unpack: true
- name: elastic-runtime
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "elastic-runtime/elastic-runtime-(.*).tar"
unpack: true
- name: czero-cflinuxfs2
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "czero-cflinuxfs2/czero-cflinuxfs2-(.*)-.*.tar"
- name: pcf-pipelines-combined
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "pcf-pipelines-combined/pcf-pipelines-combined-(.*).tar.gpg"
- name: stemcells
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "stemcells/bosh-stemcell-(.*)-.*.tgz"
- name: pcf-pipelines-tarball
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "pcf-pipelines/pcf-pipelines-(.*).tgz"
jobs:
- name: unpack-tarball
plan:
- get: pcf-pipelines-combined
trigger: true
- task: unpack-tarball
config:
platform: linux
image_resource:
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "czero-cflinuxfs2/czero-cflinuxfs2-(.*)-.*.tar"
params:
unpack: true
inputs:
- name: pcf-pipelines-combined
outputs:
- name: pcf-pipelines-separated
params:
GPG_PRIVATE_KEY: {{gpg_private_key_contents}}
run:
path: bash
args:
- -c
- |
set -eu
set -o pipefail
echo -n "Importing GPG private key..."
echo "$GPG_PRIVATE_KEY" | gpg --import 2>/dev/null
echo "done"
echo ""
echo "Extracting encrypted tarball..."
gpg --decrypt pcf-pipelines-combined/*.tar.gpg | tar xv -C pcf-pipelines-separated
echo ""
echo "Verifying SHA of extracted files..."
pushd pcf-pipelines-separated 1>/dev/null
shasum -c MANIFEST.MF
popd 1>/dev/null
- aggregate:
- put: pcf-ops-manager
params:
file: pcf-pipelines-separated/ops-manager*
- put: elastic-runtime
params:
file: pcf-pipelines-separated/elastic-runtime*
- put: czero-cflinuxfs2
params:
file: pcf-pipelines-separated/czero-cflinuxfs2*
- put: stemcells
params:
file: pcf-pipelines-separated/bosh-stemcell*
- put: pcf-pipelines-tarball
params:
file: pcf-pipelines-separated/pcf-pipelines*
- name: set-install-pcf-pipeline
plan:
- get: pcf-pipelines-tarball
passed: [unpack-tarball]
- task: unpack-pcf-pipelines
config:
platform: linux
image_resource:
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "czero-cflinuxfs2/czero-cflinuxfs2-(.*)-.*.tar"
params:
unpack: true
inputs:
- name: pcf-pipelines-tarball
outputs:
- name: pcf-pipelines
run:
path: bash
args: ["-c", "tar -C pcf-pipelines -xvf pcf-pipelines-tarball/*.tgz"]
- task: set-pipeline
config:
platform: linux
image_resource:
type: s3
source:
access_key_id: {{s3_access_key_id}}
secret_access_key: {{s3_secret_access_key}}
endpoint: {{s3_endpoint}}
bucket: {{s3_bucket}}
regexp: "czero-cflinuxfs2/czero-cflinuxfs2-(.*)-.*.tar"
params:
unpack: true
inputs:
- name: pcf-pipelines
params:
PIPELINE_PARAMS: {{rc_offline_vsphere_install_params}}
PIPELINE_NAME: {{rc_offline_pipeline_name}}
PIPELINE_PATH: pcf-pipelines/install-pcf/vsphere/pipeline.yml
ATC_EXTERNAL_URL: {{atc_external_url}}
ATC_BASIC_AUTH_USERNAME: {{atc_basic_auth_username}}
ATC_BASIC_AUTH_PASSWORD: {{atc_basic_auth_password}}
ATC_TEAM_NAME: {{atc_team_name}}
run:
path: bash
args:
- -c
- |
curl \
--insecure \
--output fly \
"${ATC_EXTERNAL_URL}/api/v1/cli?arch=amd64&platform=linux"
chmod +x fly
./fly --target self login \
--insecure \
--concourse-url "${ATC_EXTERNAL_URL}" \
--username "${ATC_BASIC_AUTH_USERNAME}" \
--password "${ATC_BASIC_AUTH_PASSWORD}" \
--team-name "${ATC_TEAM_NAME}"
IFS=$'\n'
for line in $PIPELINE_PARAMS; do
echo "$line" >> params.yml
done
./fly --target self set-pipeline \
--non-interactive \
--pipeline "${PIPELINE_NAME}" \
--config "${PIPELINE_PATH}" \
--load-vars-from params.yml