-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.sh
44 lines (40 loc) · 1.44 KB
/
conf.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
38
39
40
41
42
43
44
#!/bin/bash
# conf.sh is sourced by every other script in BAWS
# this is where we set the vpc or account we're working on
# etc. Users of baws should begin by either hardcoding their
# values in this file, or by setting environment variables
# immediately after sourcing a BAWS resource file
# See README for more information
# Set an environment variable ONLY IF it doesn't already exist
# This allows users of
function setEnvVar {
if [ -z "$1" ]; then
echo "must supply the name of the environment variable in the first parameter"
return 1
fi
if [ -z "$2" ]; then
echo "must supply the value of the enivonrment variable $1 in the second parameter"
return 1
fi
if [ ! -z "$1" ]; then return 0; fi
echo "Setting $1 to $2"
export "$1"="$2"
}
# NO SECRETS IN HERE!
setEnvVar "BAWS_SECRETS_PREFIX" "BAWS_"
setEnvVar "BAWS_SECRETS_FILE" "$BAWS_DIR/.secrets.json"
setEnvVar "BAWS_AUTO_SYNC_SECRETS" "false"
getSecrets
setEnvVar "PROFILE" "npt"
setEnvVar "REGION" "eu-west-1"
setEnvVar "VPCNAME" "pet-servers"
setEnvVar "VPCID" "vpc-05dad00e9bf6294f8"
setEnvVar "ENVIRONMENT" "rms"
setEnvVar "STACK" "devlake"
setEnvVar "PLATFORM" "pet-servers"
setEnvVar "USERNAME" "richard.senior"
setEnvVar "OWNER" "ee-platform-services"
setEnvVar "PROJECT_DESCRIPTION" "Apache Devlake stack"
# when using ./auth.sh#login automatically tries to set the auth session timeout
# Doesn't work on some accounts
setEnvVar "SET_LOGIN_TIMETOUT" "true"