Skip to content

Commit

Permalink
fix(integ): fix for docdb test script (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-painec authored Aug 14, 2020
1 parent 6e6ed29 commit ed897f9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ set -euo pipefail

AWS_REGION=$1
DB_SECRET_ARN=$2
CERT="$(pwd)/cert"

# Retrieve login information for the database from its Secret
DB_SECRET_VALUE=$(aws secretsmanager get-secret-value --secret-id=$DB_SECRET_ARN --region=$AWS_REGION)
DB_SECRET_STRING=$(jq -r '.SecretString' <<< "$DB_SECRET_VALUE")
DB_USERNAME=$(jq -r '.username' <<< "$DB_SECRET_STRING")
DB_PASS=$(jq -r '.password' <<< "$DB_SECRET_STRING")

if [ $(ls cert) ]; then
if [ -d "$CERT" ]; then
# MongoDB instances require retrieving the value of the .pem key created for the database
CERT_CA="$(pwd)/ca-cert.crt"
CERT_CA="$CERT/ca-cert.crt"

# The domain zone for the mongo instance used is hard-coded during setup
DB_ADDRESS="mongo.renderfarm.local:27017"
Expand All @@ -40,6 +41,4 @@ fi
# Mongo command to query for "deadline10db" database
mongo --quiet --ssl --host="$DB_ADDRESS" --sslCAFile="$CERT_CA" --username="$DB_USERNAME" --password="$DB_PASS" --eval='printjson( db.adminCommand( { listDatabases: 1, nameOnly: true, filter: { "name": "deadline10db" } } ) )'

# Cleanup
rm -rf "${TMPDIR}"
exit 0
exit 0

0 comments on commit ed897f9

Please sign in to comment.