-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_env.sh
More file actions
executable file
·71 lines (62 loc) · 2.82 KB
/
setup_env.sh
File metadata and controls
executable file
·71 lines (62 loc) · 2.82 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Script to setup all configuration file
file="./apis_configs/env.properties"
if [ -f "$file" ]
then
echo "$file found."
while IFS='=' read -r key value
do
key=$(echo $key | tr '.' '_')
eval ${key}=\${value}
done < "$file"
echo "${ICDCHOST}"
if [ -f ./apis_configs/fence_creds.json ]
then
cp ./apis_configs/fence_creds.json ./apis_configs/fence_creds.json.bak
fi
cp ./apis_configs/fence_creds.json.template ./apis_configs/fence_creds.json
sed -i -e "s/ICDCHOST/${ICDCHOST}/g" ./apis_configs/fence_creds.json
sed -i -e "s/GOOGLE_C_SECRET/${GOOGLE_C_SECRET}/g" ./apis_configs/fence_creds.json
sed -i -e "s/GOOGLE_C_ID/${GOOGLE_C_ID}/g" ./apis_configs/fence_creds.json
if [ -f ./apis_configs/fence_credentials.json ]
then
cp ./apis_configs/fence_credentials.json ./apis_configs/fence_credentials.json.bak
fi
cp ./apis_configs/fence_credentials.json.template ./apis_configs/fence_credentials.json
sed -i -e "s/AWS_ACCESS_KEY_ID/${AWS_ACCESS_KEY_ID}/g" ./apis_configs/fence_credentials.json
sed -i -e "s/AWS_SECRET_ACCESS_KEY/${AWS_SECRET_ACCESS_KEY}/g" ./apis_configs/fence_credentials.json
sed -i -e "s/S3_BUCKET_NAME/${S3_BUCKET_NAME}/g" ./apis_configs/fence_credentials.json
sed -i -e "s/AWS_ROLE_ARN/${AWS_ROLE_ARN}/g" ./apis_configs/fence_credentials.json
if [ -f ./apis_configs/fence_settings.py ]
then
cp ./apis_configs/fence_settings.py ./apis_configs/fence_settings.py.bak
fi
cp ./apis_configs/fence_settings.py.template ./apis_configs/fence_settings.py
sed -i -e "s/INDEXD_HOST/${INDEXD_HOST}/g" ./apis_configs/fence_settings.py
if [ -f ./apis_configs/sheepdog_settings.py ]
then
cp ./apis_configs/sheepdog_settings.py ./apis_configs/sheepdog_settings.py.bak
fi
cp ./apis_configs/sheepdog_settings.py.template ./apis_configs/sheepdog_settings.py
sed -i -e "s/INDEXD_HOST/${INDEXD_HOST}/g" ./apis_configs/sheepdog_settings.py
if [ -f ./apis_configs/peregrine_settings.py ]
then
cp ./apis_configs/peregrine_settings.py ./apis_configs/peregrine_settings.py.bak
fi
cp ./apis_configs/peregrine_settings.py.template ./apis_configs/peregrine_settings.py
sed -i -e "s/INDEXD_HOST/${INDEXD_HOST}/g" ./apis_configs/peregrine_settings.py
if [ -f ./apis_configs/sheepdog_creds.json ]
then
cp ./apis_configs/sheepdog_creds.json ./apis_configs/sheepdog_creds.json.bak
fi
cp ./apis_configs/sheepdog_creds.json.template ./apis_configs/sheepdog_creds.json
sed -i -e "s/ICDCHOST/${ICDCHOST}/g" ./apis_configs/sheepdog_creds.json
if [ -f ./apis_configs/peregrine_creds.json ]
then
cp ./apis_configs/peregrine_creds.json ./apis_configs/peregrine_creds.json.bak
fi
cp ./apis_configs/peregrine_creds.json.template ./apis_configs/peregrine_creds.json
sed -i -e "s/ICDCHOST/${ICDCHOST}/g" ./apis_configs/peregrine_creds.json
else
echo "$file not found."
fi