Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use secrets manager to read serverless credentials #1237

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .evergreen/config/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,12 @@ functions:
./run-mongohouse-image.sh

"create serverless instance":
- command: shell.exec
- command: subprocess.exec
params:
working_dir: "src"
script: |
${PREPARE_SHELL}

bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup-secrets is now automatically called in create-instance

- command: expansions.update
params:
file: src/serverless-expansion.yml
Expand All @@ -190,17 +188,19 @@ functions:
script: |
${PREPARE_SHELL}

bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh serverless_next
VAULT_NAME=serverless_next \
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
- command: expansions.update
params:
file: src/serverless-expansion.yml

"delete serverless instance":
- command: shell.exec
- command: subprocess.exec
params:
script: |
bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
working_dir: "src"
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh

"run tests":
- command: shell.exec
Expand Down Expand Up @@ -274,10 +274,13 @@ functions:
export KMS_TLS_CA_FILE="${client_side_encryption_kms_tls_ca_file}"
export KMS_TLS_CERTIFICATE_KEY_FILE="${client_side_encryption_kms_tls_certificate_key_file}"
export MONGODB_IS_SERVERLESS=on
export MONGODB_USERNAME=${SERVERLESS_ATLAS_USER}
export MONGODB_PASSWORD=${SERVERLESS_ATLAS_PASSWORD}
export PATH="${PHP_PATH}/bin:$PATH"

. ${DRIVERS_TOOLS}/.evergreen/serverless/secrets-export.sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is created by setup-secrets and contains the secrets needed to run tests


export MONGODB_USERNAME=$SERVERLESS_ATLAS_USER
export MONGODB_PASSWORD=$SERVERLESS_ATLAS_PASSWORD
Comment on lines +281 to +282
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, it took me too long to remember that $FOO refers to an environment variable named FOO, whereas ${FOO} refers to an evergreen expansion named FOO 🤦‍♂️


CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
MONGODB_URI="${SERVERLESS_URI}" \
TESTS="serverless" \
Expand Down
Loading