-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathevergreen.yml
298 lines (263 loc) · 9.65 KB
/
evergreen.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# Evergreen Project Config
# When a task that used to pass starts to fail
# Go through all versions that may have been skipped to detect
# when the task started failing
stepback: true
# Mark a failure as a system/bootstrap failure (purple box) rather then a task
# failure by default.
# Actual testing tasks are marked with `type: test`
command_type: system
# Protect ourself against rogue test case, or curl gone wild, that runs forever
# 12 minutes is the longest we'll ever run
exec_timeout_secs: 3600 # 12 minutes is the longest we'll ever run
# What to do when evergreen hits the timeout (`post:` tasks are run automatically)
timeout:
- command: shell.exec
params:
script: |
ls -la
functions:
"build taco bundle":
- command: shell.exec
type: test
params:
shell: bash
working_dir: mongo-tableau-connector
script: |
${prepare_shell}
source ./.venv/bin/activate
# Running packager from connector-packager dir
( cd connector-plugin-sdk/connector-packager && python3 -m connector_packager.package \
--verbose ../../connector/ --dest ../../package --log ../../logs 2>&1 | tee /dev/stdout \
| grep "Taco packaged" >/dev/null)
mv package/mongodb_jdbc-*.taco package/mongodb_jdbc.taco
"fetch source":
- command: git.get_project
params:
directory: mongo-tableau-connector
"fetch packaged connector":
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongo-tableau-connector/artifacts/${version_id}/mongodb_jdbc.taco
local_file: mongo-tableau-connector/mongodb_jdbc.taco
bucket: mciuploads
"fetch signed connector":
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongo-tableau-connector/artifacts/${version_id}/mongodb_jdbc-signed.taco
local_file: mongo-tableau-connector/mongodb_jdbc-signed.taco
bucket: mciuploads
"generate expansions":
- command: shell.exec
params:
shell: bash
working_dir: mongo-tableau-connector
script: |
export MONGO_TABLEAU_CONNECTOR_VERSION=$(git describe --always | sed 's/^v//g')
export UPDATE_PLUGIN_VERSION=true
git describe --exact-match HEAD || UPDATE_PLUGIN_VERSION=false
cat <<EOT > expansions.yml
MONGO_TABLEAU_CONNECTOR_VERSION: "$MONGO_TABLEAU_CONNECTOR_VERSION"
UPDATE_PLUGIN_VERSION: "$UPDATE_PLUGIN_VERSION"
RELEASE_TACO_PATH: "mongo-tableau-connector/mongodb-jdbc-$MONGO_TABLEAU_CONNECTOR_VERSION.taco"
prepare_shell: |
set -o errexit
export MONGO_TABLEAU_CONNECTOR_VERSION="$MONGO_TABLEAU_CONNECTOR_VERSION"
export UPDATE_PLUGIN_VERSION="$UPDATE_PLUGIN_VERSION"
export RELEASE_TACO_PATH="$RELEASE_TACO_PATH"
EOT
- command: expansions.update
params:
file: mongo-tableau-connector/expansions.yml
"install connector plugin sdk":
- command: shell.exec
params:
shell: bash
working_dir: mongo-tableau-connector
script: |
${prepare_shell}
# Clone connector-plugin-sdk and install packaging module
git clone https://github.com/tableau/connector-plugin-sdk.git
source ./.venv/bin/activate
( cd connector-plugin-sdk/connector-packager && python3 setup.py install )
"setup python virtual environment":
- command: shell.exec
params:
shell: bash
working_dir: mongo-tableau-connector
script: |
${prepare_shell}
python3 -m venv .venv
"sign archive":
- command: shell.exec
type: system
params:
silent: true
script: |
${prepare_shell}
docker login --username ${sql_engines_artifactory_username} --password ${sql_engines_artifactory_auth_token} ${release_tools_container_registry}
- command: shell.exec
type: system
params:
working_dir: mongo-tableau-connector
silent: true
env:
GRS_CONFIG_USER1_USERNAME: "${tableau_garasign_username}"
GRS_CONFIG_USER1_PASSWORD: "${tableau_garasign_password}"
script: |
${prepare_shell}
docker run \
-e GRS_CONFIG_USER1_USERNAME \
-e GRS_CONFIG_USER1_PASSWORD \
--rm \
-v $(pwd):$(pwd) -w $(pwd) \
${garasign_jarsigner_image} \
/bin/bash -c "jarsigner mongodb_jdbc.taco ${authenticode_key_name} -tsa http://timestamp.digicert.com"
"update plugin-version":
- command: shell.exec
type: system
params:
working_dir: mongo-tableau-connector
silent: false
script: |
${prepare_shell}
sed -i "s/tableau-connector+0.0.0/tableau-connector+${MONGO_TABLEAU_CONNECTOR_VERSION}/g" \
connector/connectionProperties.js
if $UPDATE_PLUGIN_VERSION; then
sed -i "s/plugin-version='0.0.0'/plugin-version='${MONGO_TABLEAU_CONNECTOR_VERSION}'/g" \
connector/manifest.xml
fi
"upload packaged connector":
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-tableau-connector/package/mongodb_jdbc.taco
remote_file: mongo-tableau-connector/artifacts/${version_id}/mongodb_jdbc.taco
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
"upload packager log file":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-tableau-connector/logs/packaging_logs.txt
remote_file: mongo-tableau-connector/artifacts/${version_id}/packaging_logs.txt
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Tableau Connector Packaging Logfile"
"upload release":
- command: s3.put
params:
aws_key: ${release_aws_key}
aws_secret: ${release_aws_secret}
local_file: mongo-tableau-connector/mongodb_jdbc-signed.taco
remote_file: ${RELEASE_TACO_PATH}
bucket: translators-connectors-releases
permissions: public-read
display_name: mongodb-jdbc-${MONGO_TABLEAU_CONNECTOR_VERSION}.taco
content_type: application/octet-stream
"upload signed connector":
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-tableau-connector/mongodb_jdbc.taco
remote_file: mongo-tableau-connector/artifacts/${version_id}/mongodb_jdbc-signed.taco
bucket: mciuploads
permissions: public-read
display_name: mongodb-jdbc-signed.taco
content_type: application/octet-stream
"verify signed connector":
- command: shell.exec
type: system
params:
working_dir: mongo-tableau-connector
silent: false
script: |
${prepare_shell}
jarsigner -verify mongodb_jdbc.taco -verbose -certs -strict
"validate connector XML format":
- command: shell.exec
type: test
params:
shell: bash
working_dir: mongo-tableau-connector
script: |
${prepare_shell}
source ./.venv/bin/activate
# Running packager validation step
( cd connector-plugin-sdk/connector-packager && python3 -m connector_packager.package \
--validate-only --verbose ../../connector/ --log ../../logs 2>&1 | tee /dev/stdout \
| grep "Validation succeeded." >/dev/null)
"update download center feed":
- command: shell.exec
params:
shell: bash
working_dir: mongo-tableau-connector
script: |
${prepare_shell}
sed -i 's@{RELEASE_VERSION}@'${MONGO_TABLEAU_CONNECTOR_VERSION}'@' mongo-tableau-connector-downloads_template.json
sed -i 's@{RELEASE_TACO_PATH}@'${RELEASE_TACO_PATH}'@' mongo-tableau-connector-downloads_template.json
echo "-------------------------"
cat mongo-tableau-connector-downloads_template.json
echo "-------------------------"
- command: s3.put
params:
aws_key: ${release_aws_key}
aws_secret: ${release_aws_secret}
local_file: mongo-tableau-connector/mongo-tableau-connector-downloads_template.json
remote_file: mongo-tableau-connector/mongo-tableau-connector-downloads.json
bucket: translators-connectors-releases
permissions: public-read
content_type: application/json
pre:
- func: "fetch source"
- func: "setup python virtual environment"
- func: "generate expansions"
- func: "install connector plugin sdk"
tasks:
- name: compile
commands:
- func: "update plugin-version"
- func: "validate connector XML format"
- func: "build taco bundle"
- func: "upload packaged connector"
- func: "upload packager log file"
- name: sign
depends_on:
- name: compile
commands:
- func: "fetch packaged connector"
- func: "sign archive"
- func: "verify signed connector"
- func: "upload signed connector"
- name: release
git_tag_only: true
depends_on:
- name: sign
commands:
- func: "fetch signed connector"
- func: "upload release"
- name: download-center-update
git_tag_only: true
depends_on:
- name: release
commands:
- func: "update download center feed"
buildvariants:
- name: ubuntu2004
display_name: "Ubuntu 20.04"
run_on: [ ubuntu2004 ]
tasks:
- name: compile
- name: sign
- name: release
- name: download-center-update