- Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathrun-mongodb-aws-ecs-test.sh
37 lines (31 loc) · 1.3 KB
/
run-mongodb-aws-ecs-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Don't trace since the URI contains a password that shouldn't show up in the logs
set -o errexit # Exit the script with error if any of the commands fail
# Environment variables used as input:
# MONGODB_URI Set the URI, including username/password to use to connect to the server via MONGODBAWS authentication mechanism
# ASSERT_NO_URI_CREDS Determines whether we need assert existence credentials in connection string or not
#
# Environment variables used as output:
# AWS_TESTS_ENABLED Allows running AWS tests
# AWS_ECS_ENABLED Allows running ECS tests
#
############################################
# Main Program #
############################################
if [[ -z"$1" ]];then
echo"usage: $0 <MONGODB_URI>"
exit 1
fi
export MONGODB_URI="$1"
ifecho"$MONGODB_URI"| grep -q "@";then
echo"MONGODB_URI unexpectedly contains user credentials in ECS test!";
exit 1
fi
# Now we can safely enable xtrace
set -o xtrace
export AWS_TESTS_ENABLED=true
export AWS_ECS_ENABLED=true
# EG scripts for ECS assume that a root folder is "src" and all driver side scripts are placed in ".evergreen" folder.
# So that script is copied into "src/.evergreen" before running
cd src
./build.sh --target=TestAwsAuthentication