File size: 764 Bytes
42c94b8
 
b22dfc8
 
42c94b8
 
 
 
 
 
 
 
 
6d9c5d5
e9f1199
 
6d9c5d5
e9f1199
 
b22dfc8
 
b9db363
 
6e8129d
b9db363
 
 
b22dfc8
 
ae695b7
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
#!/bin/bash

echo "Initializing datadir..."

# Create dir if not existed in HF persistent storage
if [ ! -d "${GSK_HOME}" ]
then
  # Create HOME
  mkdir -p "${GSK_HOME}"
  # Create frontend run dir
  mkdir -p "${GSK_HOME}/run/nginx"
fi

if [ ! -z "${GISKARD_LICENSE}" ]
then
  # Use new license if env set
  echo "${GISKARD_LICENSE}" > "${GISKARD_HOME}/license.lic"
fi

echo "Detecting demo Giskard Space..."

if [ ! -z "${SPACE_ID}" ] && [ "${DEMO_SPACE_ID}" == "${SPACE_ID}" ]
then
  # Generate GISKARD_DEFAULT_API_KEY in demo space instead of set from Secrets
  export GISKARD_DEFAULT_API_KEY=gsk-$(cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-28} | head -n 1)
fi

echo "Starting supervisord..."

exec supervisord -c "${GSK_DIST_PATH}/supervisord.conf"