Skip to content

Commit

Permalink
Fix #115 - Fix DB port overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-orti committed Mar 11, 2018
1 parent f820c14 commit 50608af
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
20 changes: 13 additions & 7 deletions common/script/configureDatabase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ then
wget -nv $DB_DRIVER_URL
case $DB_DRIVER_URL in
*derby* )
rm /config/resources/derby*
mv derby* /config/resources
cp /config/datasource-derby.xml /config/datasource.xml
;;
rm /config/resources/derby*
mv derby* /config/resources
cp /config/datasource-derby.xml /config/datasource.xml
;;
*mysql* )
rm /config/resources/mysql*
mv mysql* /config/resources
cp /config/datasource-mysql.xml /config/datasource.xml
;;
mv mysql* /config/resources
cp /config/datasource-mysql.xml /config/datasource.xml
;;
*postgres* )
rm /config/resources/postgres*
mv postgres* /config/resources
Expand All @@ -28,6 +28,11 @@ then
mv db2* /config/resources
cp /config/datasource-db2.xml /config/datasource.xml
;;
*h2* )
rm /config/resources/h2*
mv h2* /config/resources
cp /config/datasource-h2.xml /config/datasource.xml
;;
esac
elif [ -n "$DB_TYPE" ]
then
Expand All @@ -49,6 +54,7 @@ then
*db2* )
cp /config/datasource-db2.xml /config/datasource.xml
;;
# For h2, we do not have to install the driver here since it is installed by default at build time (only for the standalone topology)
*h2* )
cp /config/datasource-h2.xml /config/datasource.xml
;;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Begin - Change values for the datasource if required
# Begin - Update values for the datasource if required
if [ -n "$DB_SERVER_NAME" ]
then
echo "Set database server name to $DB_SERVER_NAME"
Expand All @@ -10,7 +10,14 @@ fi
if [ -n "$DB_PORT_NUMBER" ]
then
echo "Set database port number to $DB_PORT_NUMBER"
# Update port in case of PostgreSQL
sed -i 's|5432|'$DB_PORT_NUMBER'|g' /config/datasource.xml
# Update port in case of DB2
sed -i 's|50000|'$DB_PORT_NUMBER'|g' /config/datasource.xml
# Update port in case of Derby
sed -i 's|1527|'$DB_PORT_NUMBER'|g' /config/datasource.xml
# Update port in case of MySQL
sed -i 's|3306|'$DB_PORT_NUMBER'|g' /config/datasource.xml
fi

if [ -n "$DB_NAME" ]
Expand All @@ -28,4 +35,4 @@ if [ -n "$DB_PASSWORD" ]
then
sed -i 's|odmpwd|'$DB_PASSWORD'|g' /config/datasource.xml
fi
# End - Change values for the datasource if required
# End - Update values for the datasource if required
2 changes: 1 addition & 1 deletion decisioncenter/script/rundc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $SCRIPT/configureTlsSecurity.sh

$SCRIPT/configureDatabase.sh

$SCRIPT/changeDatasource.sh
$SCRIPT/updateDatasource.sh

$SCRIPT/addRestApi.sh

Expand Down
2 changes: 1 addition & 1 deletion decisionserver/decisionrunner/script/rundr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ $SCRIPT/configureTlsSecurity.sh

$SCRIPT/configureDatabase.sh

$SCRIPT/changeDatasource.sh
$SCRIPT/updateDatasource.sh

/opt/ibm/wlp/bin/server run defaultServer
2 changes: 1 addition & 1 deletion decisionserver/decisionserverconsole/script/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $SCRIPT/configureTlsSecurity.sh

$SCRIPT/configureDatabase.sh

$SCRIPT/changeDatasource.sh
$SCRIPT/updateDatasource.sh

$SCRIPT/updateDSRConfigurations.sh

Expand Down
2 changes: 1 addition & 1 deletion decisionserver/decisionserverruntime/script/runds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ $SCRIPT/enableMetering.sh

$SCRIPT/configureDatabase.sh

$SCRIPT/changeDatasource.sh
$SCRIPT/updateDatasource.sh

/opt/ibm/wlp/bin/server run defaultServer
2 changes: 1 addition & 1 deletion standalone/script/runserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $SCRIPT/enableMetering.sh

$SCRIPT/configureDatabase.sh h2

$SCRIPT/changeDatasource.sh
$SCRIPT/updateDatasource.sh

$SCRIPT/updatePersistenceLocale.sh

Expand Down

0 comments on commit 50608af

Please sign in to comment.