Skip to content

Commit 3553e6c

Browse files
authored
fix(ci): setup ssh key safely COMPASS-7621 (#5431)
fix(ci): setup ssh key safely
1 parent 1390ae2 commit 3553e6c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.evergreen/functions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,16 @@ functions:
331331
wait: true
332332
# copy ssh key (this key will be used to connect to ssh server)
333333
- command: shell.exec
334+
silent: true
334335
params:
336+
working_dir: src
335337
shell: bash
338+
env:
339+
__project_aws_ssh_key_value: ${__project_aws_ssh_key_value}
336340
script: |
337341
set -e
338-
{
339-
set +x
340-
echo '${__project_aws_ssh_key_value}' > ~/.ssh/mcipacker.pem
341-
chmod 0600 ~/.ssh/mcipacker.pem
342-
set -x
343-
}
342+
.evergreen/setup-ssh-key.sh
343+
344344
# wait for host to be ready
345345
- command: shell.exec
346346
params:

.evergreen/setup-ssh-key.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /usr/bin/env bash
2+
3+
set -e
4+
set +x
5+
echo "${__project_aws_ssh_key_value}" > ~/.ssh/mcipacker.pem
6+
chmod 0600 ~/.ssh/mcipacker.pem

0 commit comments

Comments
 (0)