-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.sh
22 lines (14 loc) · 964 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
if [ "$MYSQL_SERVICE_DNS_NAME" ]; then
TEMP_MYSQL=`echo $MYSQL_SERVICE_DNS_NAME |sed "s/-/_/g" |tr [a-z] [A-Z]`_SERVICE_HOST
eval MYSQL_SERVICE_NAME=\${$TEMP_MYSQL}
fi
if [ "$MYSQL_PORT_3306_TCP_ADDR" ]; then
sed -i 's/^jdbc.url=.*$/jdbc.url=jdbc:mysql:\/\/'$MYSQL_PORT_3306_TCP_ADDR':'$MYSQL_PORT_3306_TCP_PORT'\/'$MYSQL_ENV_MYSQL_DATABASE' /g' /usr/local/tomcat/webapps/datahub_user-1.0-SNAPSHOT/WEB-INF/classes/config.properties
sed -i 's/^jdbc.username=.*$/jdbc.username='$MYSQL_ENV_MYSQL_USER'/g' /usr/local/tomcat/webapps/datahub_user-1.0-SNAPSHOT/WEB-INF/classes/config.properties
sed -i 's/^jdbc.password=.*$/jdbc.password='$MYSQL_ENV_MYSQL_PASSWORD'/g' /usr/local/tomcat/webapps/datahub_user-1.0-SNAPSHOT/WEB-INF/classes/config.properties
fi
if [ "$API_SERVER" ] && [ "$API_PORT" ]; then
echo "var ngUrl=\"http://"$API_SERVER:$API_PORT"/\";" > /usr/local/tomcat/webapps/src/main/webapp/recom/js/ngUrl.js
fi
catalina.sh run