Skip to content

Commit 15e9271

Browse files
committed
update the docker entrypoint for spring
1 parent 5583841 commit 15e9271

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

docker/web-and-data/docker-entrypoint.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ parse_db_params_from_config_and_command_line() {
2323
else
2424
PROPERTIES_FILE=$BAKED_IN_WAR_CONFIG_FILE
2525
fi
26-
for param in db.host db.user db.portal_db_name db.password db.connection_string; do
26+
for param in db.host db.user db.portal_db_name db.password db.connection_string spring.datasource.url; do
2727
if $(parse_db_params_from_command_line $@ | grep -q $param); then
2828
prop=$(parse_db_params_from_command_line $@ | grep "^$param" || [[ $? == 1 ]])
2929
else
@@ -33,7 +33,8 @@ parse_db_params_from_config_and_command_line() {
3333
then
3434
# Replace dot in parameter name with underscore.
3535
prop=$(sed "s/^db\./db_/" <<< $prop)
36-
if [[ $param == db.connection_string ]]
36+
prop=$(sed "s/^spring\.datasource\.url/spring\_datasource\_url/" <<< $prop)
37+
if [[ $param == spring.datasource.url ]]
3738
then
3839
# Remove the parameters (?...) from the connection URL.
3940
echo $(sed -r "s/^([^=]+)=([^\?]+).*/\1=\2/" <<< $prop)
@@ -59,20 +60,20 @@ parse_connection_string() {
5960
check_db_connection() {
6061
eval $(parse_db_params_from_config_and_command_line $@)
6162

62-
if [[ -n $db_host ]] || [[ -n $db_portal_db_name ]] || [[ -n $db_use_ssl ]]
63+
if [[ -n $db_host ]] || [[ -n $db_portal_db_name ]] || [[ -n $db_use_ssl ]] || [[ -n $db_connection_string ]]
6364
then
6465
echo "----------------------------------------------------------------------------------------------------------------"
6566
echo "-- Connection error:"
66-
echo "-- You try to connect to the database using the deprecated 'db.host', 'db.portal_db_name' and 'db.use_ssl' properties."
67-
echo "-- Please remove these properties and use the 'db.connection_string' property instead. See https://docs.cbioportal.org/deployment/customization/application.properties-reference/"
67+
echo "-- You try to connect to the database using the deprecated 'db.host', 'db.portal_db_name' and 'db.use_ssl' or 'db.connection_string' properties."
68+
echo "-- Please remove these properties and use the 'spring.datasource.url' property instead. See https://docs.cbioportal.org/deployment/customization/application.properties-reference/"
6869
echo "-- for assistance on building a valid connection string."
6970
echo "------------------------------------------------------------f---------------------------------------------------"
7071
exit 1
7172
fi
7273

73-
if [[ -n $db_connection_string ]]
74+
if [[ -n $spring_datasource_url ]]
7475
then
75-
eval "$(parse_connection_string $db_connection_string)"
76+
eval "$(parse_connection_string $spring_datasource_url)"
7677
fi
7778

7879
if [ -z ${db_port+x} ] # is $db_port unset?

docs/deployment/customization/application.properties-Reference.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ This page describes the main properties within application.properties.
77
```
88
db.user=
99
db.password=
10-
db.connection_string=
11-
db.driver=[this is the name of your JDBC driver, e.g., com.mysql.jdbc.Driver]
10+
spring.datasource.url=
11+
spring.datasource.driver-class-name=[this is the name of your JDBC driver, e.g., com.mysql.jdbc.Driver]
1212
```
1313

14-
The format of the `db.connection_string` is:
14+
The format of the `spring.datasource.url` is:
1515
```
1616
jdbc:mysql://<host>:<port>/<database name>?<parameter1>&<parameter2>&<parameter...>
1717
```
@@ -22,14 +22,8 @@ For example:
2222
jdbc:mysql://localhost:3306/cbiodb?zeroDateTimeBehavior=convertToNull&useSSL=false
2323
```
2424

25-
:warning: The fields `db.host` and `db.portal_db_name` and `db.use_ssl` are deprecated. It is required to configure the database connection using
26-
the `db.connection_string` instead.
27-
28-
`db.tomcat_resource_name` is required in order to work with the tomcat database connection pool and should have the default value jdbc/cbioportal in order to work correctly with the your WAR file.
29-
30-
```
31-
db.tomcat_resource_name=jdbc/cbioportal
32-
```
25+
:warning: The fields `db.host` and `db.portal_db_name` and `db.use_ssl` and `db.connection_string` are deprecated. It is required to configure the database connection using
26+
the `spring.datasource.url` instead.
3327

3428
## cBioPortal Customization
3529

0 commit comments

Comments
 (0)