Skip to content

Commit

Permalink
fix(ci): setup ssh key safely COMPASS-7621 (#5431)
Browse files Browse the repository at this point in the history
fix(ci): setup ssh key safely
  • Loading branch information
kmruiz committed Feb 9, 2024
1 parent 1390ae2 commit 3553e6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,16 @@ functions:
wait: true
# copy ssh key (this key will be used to connect to ssh server)
- command: shell.exec
silent: true
params:
working_dir: src
shell: bash
env:
__project_aws_ssh_key_value: ${__project_aws_ssh_key_value}
script: |
set -e
{
set +x
echo '${__project_aws_ssh_key_value}' > ~/.ssh/mcipacker.pem
chmod 0600 ~/.ssh/mcipacker.pem
set -x
}
.evergreen/setup-ssh-key.sh
# wait for host to be ready
- command: shell.exec
params:
Expand Down
6 changes: 6 additions & 0 deletions .evergreen/setup-ssh-key.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /usr/bin/env bash

set -e
set +x
echo "${__project_aws_ssh_key_value}" > ~/.ssh/mcipacker.pem
chmod 0600 ~/.ssh/mcipacker.pem

0 comments on commit 3553e6c

Please sign in to comment.