Skip to content

Commit bff482f

Browse files
committed
BI-1117: Sign msi installer
1 parent a1af6e8 commit bff482f

File tree

3 files changed

+118
-11
lines changed

3 files changed

+118
-11
lines changed

.evg.yml

Lines changed: 112 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ buildvariants:
44

55
- matrix_name: full_matrix
66
display_name: "${os}"
7-
tasks: ["*"]
7+
tasks:
8+
- name: compile
9+
- name: sign
10+
run_on: linux-64-amzn-build
11+
- name: unit_tests
12+
- name: integration_tests_plain
13+
- name: integration_tests_scram
814
matrix_spec:
915
os: "*"
1016

@@ -20,14 +26,23 @@ post:
2026

2127
tasks:
2228

23-
- name: dist
29+
- name: compile
2430
exec_timeout_secs: 14400 # 4h
2531
commands:
2632
- func: "install dependencies"
2733
- func: "build mongosql_auth"
2834
vars:
2935
release: true
30-
- func: "create release"
36+
- func: "create packages"
37+
- func: "upload packages"
38+
39+
- name: sign
40+
depends_on:
41+
- name: compile
42+
commands:
43+
- func: "fetch packages"
44+
- func: "sign msi installer"
45+
- func: "upload release packages"
3146

3247
- name: unit_tests
3348
exec_timeout_secs: 14400 # 4h
@@ -66,13 +81,13 @@ functions:
6681
export RELEASE='${release}'
6782
${SCRIPT_DIR}/build-mongosql-auth.sh
6883
69-
"create release":
84+
"create packages":
7085
command: shell.exec
7186
type: test
7287
params:
7388
script: |
7489
${PREPARE_SHELL}
75-
${SCRIPT_DIR}/create-release.sh
90+
${SCRIPT_DIR}/create-packages.sh
7691
7792
"export variables":
7893
- command: shell.exec
@@ -99,6 +114,7 @@ functions:
99114
100115
# create expansions from values calculated above
101116
cat <<EOT > $PROJECT_DIR/expansions.yml
117+
PROJECT_DIR: "$PROJECT_DIR"
102118
SCRIPT_DIR: "$SCRIPT_DIR"
103119
CURRENT_VERSION: "$CURRENT_VERSION"
104120
PUSH_NAME: "$PUSH_NAME"
@@ -115,6 +131,15 @@ functions:
115131
params:
116132
file: mongosql-auth-c/expansions.yml
117133

134+
"fetch packages":
135+
- command: s3.get
136+
params:
137+
aws_key: ${aws_key}
138+
aws_secret: ${aws_secret}
139+
remote_file: mongosql-auth-c/artifacts/${version_id}/${build_variant}/pkg/release-bundles.tgz
140+
extract_to: mongosql-auth-c/test/artifacts/
141+
bucket: mciuploads
142+
118143
"fetch source":
119144
- command: shell.exec
120145
params:
@@ -172,6 +197,24 @@ functions:
172197
${PREPARE_SHELL}
173198
${SCRIPT_DIR}/run-unit-tests.sh
174199
200+
"sign msi installer":
201+
- command: shell.exec
202+
params:
203+
silent: true
204+
script: |
205+
echo "${signing_token_bi_connector}" > ${PROJECT_DIR}/signing_auth_token
206+
- command: shell.exec
207+
params:
208+
working_dir: mongosql-auth-c/test/artifacts
209+
script: |
210+
/usr/local/bin/notary-client.py \
211+
--key-name "bi-connector" \
212+
--auth-token-file ${PROJECT_DIR}/signing_auth_token \
213+
--comment "Evergreen Automatic Signing (mongosql-auth-c) - ${version_id} - ${build_variant}" \
214+
--notary-url http://notary-service.build.10gen.cc:5000 \
215+
--skip-missing \
216+
release.msi
217+
175218
"start mongo-orchestration":
176219
- command: shell.exec
177220
params:
@@ -225,6 +268,17 @@ functions:
225268
bucket: mciuploads
226269
permissions: public-read
227270
display_name: "mongosql-auth.msi"
271+
- command: s3.put
272+
params:
273+
optional: true
274+
aws_key: ${aws_key}
275+
aws_secret: ${aws_secret}
276+
local_file: mongosql-auth-c/test/artifacts/release-signed.msi
277+
remote_file: mongosql-auth-c/artifacts/${build_variant}/${task_id}/mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.msi
278+
content_type: application/x-msi
279+
bucket: mciuploads
280+
permissions: public-read
281+
display_name: "mongosql-auth-signed.msi"
228282
- command: s3.put
229283
params:
230284
optional: true
@@ -345,6 +399,59 @@ functions:
345399
permissions: public-read
346400
display_name: "create-release.log"
347401

402+
"upload packages":
403+
- command: archive.targz_pack
404+
params:
405+
target: mongosql-auth-c/test/artifacts/upload.tgz
406+
source_dir: mongosql-auth-c/test/artifacts/
407+
include:
408+
- "./release.*"
409+
- command: s3.put
410+
params:
411+
aws_key: ${aws_key}
412+
aws_secret: ${aws_secret}
413+
local_file: mongosql-auth-c/test/artifacts/upload.tgz
414+
remote_file: mongosql-auth-c/artifacts/${version_id}/${build_variant}/pkg/release-bundles.tgz
415+
content_type: application/x-gzip
416+
bucket: mciuploads
417+
permissions: public-read
418+
display_name: All Release Bundles (.tgz)
419+
420+
"upload release packages":
421+
- command: s3.put
422+
params:
423+
optional: true
424+
aws_key: ${aws_key}
425+
aws_secret: ${aws_secret}
426+
local_file: mongosql-auth-c/test/artifacts/release.tgz
427+
remote_file: mongosql-auth-c/artifacts/${build_variant}/${task_id}/mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.tgz
428+
content_type: application/x-gzip
429+
bucket: mciuploads
430+
permissions: public-read
431+
display_name: mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.tgz
432+
- command: s3.put
433+
params:
434+
optional: true
435+
aws_key: ${aws_key}
436+
aws_secret: ${aws_secret}
437+
local_file: mongosql-auth-c/test/artifacts/release.zip
438+
remote_file: mongosql-auth-c/artifacts/${build_variant}/${task_id}/mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.zip
439+
content_type: application/x-gzip
440+
bucket: mciuploads
441+
permissions: public-read
442+
display_name: mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.zip
443+
- command: s3.put
444+
params:
445+
optional: true
446+
aws_key: ${aws_key}
447+
aws_secret: ${aws_secret}
448+
local_file: mongosql-auth-c/test/artifacts/release-signed.msi
449+
remote_file: mongosql-auth-c/artifacts/${build_variant}/${task_id}/mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.msi
450+
content_type: application/x-msi
451+
bucket: mciuploads
452+
permissions: public-read
453+
display_name: mongosql-auth-${PUSH_NAME}-${PUSH_ARCH}-${CURRENT_VERSION}.msi
454+
348455
axes:
349456

350457
- id: os
File renamed without changes.

test/bin/download-sqlproxy.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,24 @@ def fetch_urls(self):
126126
response.raise_for_status()
127127
build = json.loads(response.text)
128128
task = build["tasks"]
129-
dist = task.get("dist", None)
129+
sign = task.get("sign", None)
130130

131-
if dist is None:
132-
print("No dist task found for '%s'" % (build["name"]))
131+
if sign is None:
132+
print("No sign task found for '%s'" % (build["name"]))
133133
continue
134134

135-
status = dist.get("status", None)
135+
status = sign.get("status", None)
136136

137137
if status is None:
138138
print("No status found for '%s'" % (build["name"]))
139139
sys.exit(1)
140140

141141
if status != "success":
142-
print("%s dist has status '%s', exiting..." % (build["name"], \
142+
print("%s sign has status '%s', exiting..." % (build["name"], \
143143
status))
144144
continue
145145

146-
url = "%s/tasks/%s" % (EVG_BASE, dist["task_id"])
146+
url = "%s/tasks/%s" % (EVG_BASE, sign["task_id"])
147147
print("Fetching task %s..." % (url))
148148
response = requests.get(url, headers=headers)
149149

0 commit comments

Comments
 (0)