Skip to content

Commit be0c816

Browse files
authored
Fix publish adding NOTARY_KEY_NAME (#106)
1 parent 827a46d commit be0c816

File tree

2 files changed

+170
-129
lines changed

2 files changed

+170
-129
lines changed

.evergreen.yml

Lines changed: 21 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -64,42 +64,6 @@ functions:
6464
env:
6565
<<: *go_options
6666
command: make package
67-
"set up remote credentials":
68-
command: shell.exec
69-
params:
70-
silent: true
71-
script: |
72-
set -o errexit
73-
# Since the macros 'private_key_remote' and 'private_key_file' are not always defined
74-
# we default to /dev/null to avoid syntax errors of an empty expansion.
75-
if [ ! -z "${private_key_remote}" ] && [ ! -z "${private_key_file}" ] ; then
76-
mkdir -p ~/.ssh
77-
echo -n "${private_key_remote}" > ${private_key_file|/dev/null}
78-
chmod 0600 ${private_key_file|/dev/null}
79-
fi
80-
# Ensure a clean aws configuration state
81-
rm -rf ~/.aws
82-
mkdir -p ~/.aws
83-
# If ${aws_profile_remote} is not specified then the config & credentials are
84-
# stored in the 'default' profile.
85-
aws_profile="${aws_profile_remote|default}"
86-
# The profile in the config file is specified as [profile <profile>], except
87-
# for [default], see http://boto3.readthedocs.io/en/latest/guide/configuration.html
88-
if [ $aws_profile = "default" ] ; then
89-
aws_profile_config="[default]"
90-
else
91-
aws_profile_config="[profile $aws_profile]"
92-
fi
93-
cat <<EOF >> ~/.aws/config
94-
$aws_profile_config
95-
region = us-east-1
96-
EOF
97-
# The profile in the credentials file is specified as [<profile>].
98-
cat <<EOF >> ~/.aws/credentials
99-
[$aws_profile]
100-
aws_access_key_id = ${aws_key_remote}
101-
aws_secret_access_key = ${aws_secret_remote}
102-
EOF
10367
"set up notary client credentials":
10468
- command: shell.exec
10569
params:
@@ -109,21 +73,21 @@ functions:
10973
set -o errexit
11074
11175
cat <<EOF > notary_env.sh
76+
export NOTARY_KEY_NAME='server-4.4'
11277
export NOTARY_TOKEN=${signing_auth_token_44}
11378
export BARQUE_USERNAME=${barque_user}
11479
export BARQUE_PASSWORD=${barque_password}
11580
EOF
11681
117-
if [[ ! -f signing_auth_token_44 ]]; then
118-
echo "${signing_auth_token_44}" > signing_auth_token
119-
fi
82+
echo "${signing_auth_token_44}" > ./signing_auth_token
12083
"push":
12184
- command: shell.exec
12285
params:
12386
working_dir: mongocli
12487
script: |
12588
. ./notary_env.sh
12689
90+
set -o xtrace
12791
set -o errexit
12892
set -o verbose
12993
@@ -134,14 +98,17 @@ functions:
13498
# We get the raw version string (v1.2.3-45-gabcdef) from git
13599
VERSION=$(git describe --abbrev=7 | cut -d "v" -f 2)
136100
137-
./curator repo submit \
101+
./curator \
102+
--level debug \
103+
repo submit \
138104
--service ${barque_url} \
139-
--config .repo_config.yml \
105+
--config etc/repo_config.yml \
140106
--distro ${distro} \
141107
--edition ${edition} \
142108
--version $VERSION \
143109
--arch x86_64 \
144-
--packages https://s3.amazonaws.com/mongodb-mongocli-build/${project}/${revision}/dist/mongocli_next_${revision}_${version_id}_${created_at}_linux_x86_64.${ext}
110+
--packages https://s3.amazonaws.com/mongodb-mongocli-build/${project}/dist/${build_id}/${ext}.tgz
111+
145112
tasks:
146113
- name: compile
147114
commands:
@@ -155,23 +122,18 @@ tasks:
155122
- func: "gen-notices"
156123
- func: "fetch goreleaser"
157124
- func: "package"
158-
- command: shell.exec
125+
- command: archive.targz_pack
159126
params:
160-
working_dir: mongocli/dist
161-
script: |
162-
set -o errexit
163-
set -o verbose
164-
165-
# we could generate a similar name with goreleaser but we want to keep the vars evg compatibale to use later
166-
mv mongocli_next_linux_i386.deb mongocli_next_${revision}_${version_id}_${created_at}_linux_i386.deb
167-
mv mongocli_next_linux_i386.rpm mongocli_next_${revision}_${version_id}_${created_at}_linux_i386.rpm
168-
mv mongocli_next_linux_i386.tar.gz mongocli_next_${revision}_${version_id}_${created_at}_linux_i386.tar.gz
169-
mv mongocli_next_linux_x86_64.deb mongocli_next_${revision}_${version_id}_${created_at}_linux_x86_64.deb
170-
mv mongocli_next_linux_x86_64.rpm mongocli_next_${revision}_${version_id}_${created_at}_linux_x86_64.rpm
171-
mv mongocli_next_linux_x86_64.tar.gz mongocli_next_${revision}_${version_id}_${created_at}_linux_x86_64.tar.gz
172-
mv mongocli_next_macos_x86_64.tar.gz mongocli_next_${revision}_${version_id}_${created_at}_macOS_x86_64.tar.gz
173-
mv mongocli_next_windows_i386.zip mongocli_next_${revision}_${version_id}_${created_at}_windows_i386.zip
174-
mv mongocli_next_windows_x86_64.zip mongocli_next_${revision}_${version_id}_${created_at}_windows_x86_64.zip
127+
target: mongocli/dist/deb.tgz
128+
source_dir: mongocli/dist
129+
include:
130+
- "mongocli_next_linux_x86_64.deb"
131+
- command: archive.targz_pack
132+
params:
133+
target: mongocli/dist/rpm.tgz
134+
source_dir: mongocli/dist
135+
include:
136+
- "mongocli_next_linux_x86_64.rpm"
175137
- command: s3.put
176138
params:
177139
aws_key: ${aws_key}
@@ -181,7 +143,7 @@ tasks:
181143
- mongocli/dist/*.zip
182144
- mongocli/dist/*.deb
183145
- mongocli/dist/*.rpm
184-
remote_file: ${project}/${revision}/dist/
146+
remote_file: ${project}/dist/${build_id}/
185147
bucket: mongodb-mongocli-build
186148
permissions: public-read
187149
content_type: ${content_type|application/x-gzip}
@@ -197,10 +159,6 @@ tasks:
197159
- name: package
198160
commands:
199161
- func: "clone"
200-
- func: "set up remote credentials"
201-
vars:
202-
aws_key_remote: ${repo_aws_key}
203-
aws_secret_remote: ${repo_aws_secret}
204162
- func: "set up notary client credentials"
205163
- func: "push"
206164
vars:
@@ -217,10 +175,6 @@ tasks:
217175
- name: package
218176
commands:
219177
- func: "clone"
220-
- func: "set up remote credentials"
221-
vars:
222-
aws_key_remote: ${repo_aws_key}
223-
aws_secret_remote: ${repo_aws_secret}
224178
- func: "set up notary client credentials"
225179
- func: "push"
226180
vars:
@@ -238,10 +192,6 @@ tasks:
238192
- name: package
239193
commands:
240194
- func: "clone"
241-
- func: "set up remote credentials"
242-
vars:
243-
aws_key_remote: ${repo_aws_key}
244-
aws_secret_remote: ${repo_aws_secret}
245195
- func: "set up notary client credentials"
246196
- func: "push"
247197
vars:
@@ -259,10 +209,6 @@ tasks:
259209
- name: package
260210
commands:
261211
- func: "clone"
262-
- func: "set up remote credentials"
263-
vars:
264-
aws_key_remote: ${repo_aws_key}
265-
aws_secret_remote: ${repo_aws_secret}
266212
- func: "set up notary client credentials"
267213
- func: "push"
268214
vars:
@@ -296,10 +242,6 @@ tasks:
296242
- name: package
297243
commands:
298244
- func: "clone"
299-
- func: "set up remote credentials"
300-
vars:
301-
aws_key_remote: ${repo_aws_key}
302-
aws_secret_remote: ${repo_aws_secret}
303245
- func: "set up notary client credentials"
304246
- func: "push"
305247
vars:
@@ -318,10 +260,6 @@ tasks:
318260
- name: package
319261
commands:
320262
- func: "clone"
321-
- func: "set up remote credentials"
322-
vars:
323-
aws_key_remote: ${repo_aws_key}
324-
aws_secret_remote: ${repo_aws_secret}
325263
- func: "set up notary client credentials"
326264
- func: "push"
327265
vars:
@@ -338,10 +276,6 @@ tasks:
338276
- name: package
339277
commands:
340278
- func: "clone"
341-
- func: "set up remote credentials"
342-
vars:
343-
aws_key_remote: ${repo_aws_key}
344-
aws_secret_remote: ${repo_aws_secret}
345279
- func: "set up notary client credentials"
346280
- func: "push"
347281
vars:
@@ -359,11 +293,6 @@ tasks:
359293
- name: package
360294
commands:
361295
- func: "clone"
362-
- func: "set up remote credentials"
363-
vars:
364-
aws_key_remote: ${repo_aws_key}
365-
aws_secret_remote: ${repo_aws_secret}
366-
- func: "set up notary client credentials"
367296
- func: "push"
368297
vars:
369298
edition: enterprise
@@ -379,10 +308,6 @@ tasks:
379308
- name: package
380309
commands:
381310
- func: "clone"
382-
- func: "set up remote credentials"
383-
vars:
384-
aws_key_remote: ${repo_aws_key}
385-
aws_secret_remote: ${repo_aws_secret}
386311
- func: "set up notary client credentials"
387312
- func: "push"
388313
vars:
@@ -400,10 +325,6 @@ tasks:
400325
- name: package
401326
commands:
402327
- func: "clone"
403-
- func: "set up remote credentials"
404-
vars:
405-
aws_key_remote: ${repo_aws_key}
406-
aws_secret_remote: ${repo_aws_secret}
407328
- func: "set up notary client credentials"
408329
- func: "push"
409330
vars:
@@ -420,10 +341,6 @@ tasks:
420341
- name: package
421342
commands:
422343
- func: "clone"
423-
- func: "set up remote credentials"
424-
vars:
425-
aws_key_remote: ${repo_aws_key}
426-
aws_secret_remote: ${repo_aws_secret}
427344
- func: "set up notary client credentials"
428345
- func: "push"
429346
vars:
@@ -441,10 +358,6 @@ tasks:
441358
- name: package
442359
commands:
443360
- func: "clone"
444-
- func: "set up remote credentials"
445-
vars:
446-
aws_key_remote: ${repo_aws_key}
447-
aws_secret_remote: ${repo_aws_secret}
448361
- func: "set up notary client credentials"
449362
- func: "push"
450363
vars:
@@ -461,11 +374,6 @@ tasks:
461374
- name: package
462375
commands:
463376
- func: "clone"
464-
- func: "set up remote credentials"
465-
vars:
466-
aws_key_remote: ${repo_aws_key}
467-
aws_secret_remote: ${repo_aws_secret}
468-
- func: "set up notary client credentials"
469377
- func: "push"
470378
vars:
471379
edition: org
@@ -482,10 +390,6 @@ tasks:
482390
- name: package
483391
commands:
484392
- func: "clone"
485-
- func: "set up remote credentials"
486-
vars:
487-
aws_key_remote: ${repo_aws_key}
488-
aws_secret_remote: ${repo_aws_secret}
489393
- func: "set up notary client credentials"
490394
- func: "push"
491395
vars:
@@ -502,10 +406,6 @@ tasks:
502406
- name: package
503407
commands:
504408
- func: "clone"
505-
- func: "set up remote credentials"
506-
vars:
507-
aws_key_remote: ${repo_aws_key}
508-
aws_secret_remote: ${repo_aws_secret}
509409
- func: "set up notary client credentials"
510410
- func: "push"
511411
vars:
@@ -523,10 +423,6 @@ tasks:
523423
- name: package
524424
commands:
525425
- func: "clone"
526-
- func: "set up remote credentials"
527-
vars:
528-
aws_key_remote: ${repo_aws_key}
529-
aws_secret_remote: ${repo_aws_secret}
530426
- func: "set up notary client credentials"
531427
- func: "push"
532428
vars:
@@ -543,10 +439,6 @@ tasks:
543439
- name: package
544440
commands:
545441
- func: "clone"
546-
- func: "set up remote credentials"
547-
vars:
548-
aws_key_remote: ${repo_aws_key}
549-
aws_secret_remote: ${repo_aws_secret}
550442
- func: "set up notary client credentials"
551443
- func: "push"
552444
vars:

0 commit comments

Comments
 (0)