3 cd $SDC_HOME || { echo "$(date) Failed to access directory $SDC_HOME"; exit 1; }
8 if [ -n "${CS_HOST_IP}" ]; then
12 if [ -n "${CS_HOST_PORT}" ]; then
16 echo "$(date) [Info] Going to initialize sdc onboard cassandra: user=$SDC_USER; host=$CS_HOST; port=$CS_PORT"
18 echo "$(date) [Info] Initializing onboard keyspaces"
19 cqlsh -u "$SDC_USER" -p "$SDC_PASSWORD" -f init_keyspaces.cql "$CS_HOST" "$CS_PORT"
23 echo "$(date) [Error] Failed to initialize onboard keyspaces";
26 echo "$(date) [Info] Finished initializing onboard keyspaces"
28 echo "$(date) [Info] Initializing onboard schemas"
29 cqlsh -u "$SDC_USER" -p "$SDC_PASSWORD" -f init_schemas.cql "$CS_HOST" "$CS_PORT"
33 echo "$(date) [Error] Failed to initialize onboard schemas";
36 echo "$(date) [Info] Finished initializing onboard schemas"
38 echo "$(date) [Info] Upgrading onboard schemas"
39 for entry in "$SDC_HOME/upgrade-scripts"/*
41 echo "$(date) Running upgrade file '$entry'"
42 cqlsh -u "$SDC_USER" -p "$SDC_PASSWORD" -f "$entry" "$CS_HOST" "$CS_PORT"
45 echo "$(date) [Warn] Upgrade failed for file '$entry'. It is possible that the upgrade was previously applied.";
47 echo "$(date) Successfully ran upgrade file '$entry'"
50 echo "$(date) [Info] Onboarding init was successful"