-
Notifications
You must be signed in to change notification settings - Fork 3
/
tap_managesettings.sh
86 lines (70 loc) · 2.57 KB
/
tap_managesettings.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
function validatePasswords(){
if [[ -f "$REGISTRY_PASSWORD_FILE" ]]; then
log "Reading registry password file $REGISTRY_PASSWORD_FILE"
REGISTRY_PASSWORD=$(cat $REGISTRY_PASSWORD_FILE)
else
log "No Registry password file set so using REGISTRY_PASSWORD variable value"
fi
if [[ -f "$PIVNET_PASSWORD_FILE" ]]; then
log "Reading pivotal network password file $PIVNET_PASSWORD_FILE"
PIVNET_PASSWORD=$(cat $PIVNET_PASSWORD_FILE)
else
log "No pivotal network password file set so using PIVNET_PASSWORD variable value"
fi
if [[ -f "$GIT_ACCESS_TOKEN_FILE" ]]; then
log "Reading Git access token file $GIT_ACCESS_TOKEN_FILE"
GIT_ACCESS_TOKEN=$(cat $GIT_ACCESS_TOKEN_FILE)
else
log "No Git access token file defined so using GIT_ACCESS_TOKEN variable value"
fi
if [[ -f "$GIT_AUTH_CLIENTID_FILE" ]]; then
log "Reading Git auth access token file $GIT_AUTH_CLIENTID_FILE"
GIT_AUTH_CLIENTID=$(cat $GIT_AUTH_CLIENTID_FILE)
else
log "No Git clientid file defined so using GIT_AUTH_CLIENTID variable value"
fi
if [[ -f "$GIT_AUTH_SECRET_FILE" ]]; then
log "Reading Git app auth secretfile $GIT_AUTH_SECRET_FILE"
GIT_AUTH_SECRET=$(cat $GIT_AUTH_SECRET_FILE)
else
log "No Git auth secret file defined so using GIT_AUTH_SECRET variable value"
fi
if [[ -f "$DOC_BUCKET_CRED_FILE" ]]; then
log "Reading Storgae bucket credential file $DOC_BUCKET_CRED_FILE"
DOC_BUCKET_CRED=$(cat $DOC_BUCKET_CRED_FILE)
else
log "No Storage bucket credentials file so using DOC_BUCKET_CRED variable value"
fi
if [[ -f "$GIT_SSH_KEY_FILE" ]]; then
log "Reading Git SSH key file $GIT_SSH_KEY_FILE"
GIT_SSH_KEY=$(cat $GIT_SSH_KEY_FILE)
else
log "No Git SSH Key file defined so using GIT_SSH_KEY variable"
fi
}
log "Reading password information"
validatePasswords
shopt -s nocasematch
log "Setting LB Type"
if [ "$DEPLOYMENT_MODEL" == "cluster" ]; then
SERVICE_TYPE="LoadBalancer"
CNR_PROVIDER=""
else
SERVICE_TYPE="NodePort"
CNR_PROVIDER="provider: local"
fi
log "Setting Supplychain"
if [ "$SUPPLY_CHAIN" == "testing" ]; then
SUPPLY_CHAIN_CONFIG="ootb_supply_chain_testing"
elif [ "$SUPPLY_CHAIN" == "testing_scanning" ]; then
SUPPLY_CHAIN_CONFIG="ootb_supply_chain_testing_scanning"
else
SUPPLY_CHAIN_CONFIG="ootb_supply_chain_basic"
fi
shopt -u nocasematch
log "Setting GitOps Values"
if [ "$GITOPS_ENABLED" == 1 ]; then
CONTROLLER_NOGITOPS=false
else
CONTROLLER_NOGITOPS=true
fi