Skip to content
Permalink
8a29254656
Go to file
 
 
Cannot retrieve contributors at this time
executable file 52 lines (50 sloc) 1.2 KB
#!/bin/bash
function resolvePort() {
if [[ $REPO_PORT == "default" ]]; then
case $REPO_DATABASE_TYPE in
mariadb)
echo 3306
;;
mysql)
echo 3306
;;
oracle)
echo 1521
;;
postgresql)
echo 5432
;;
sqlserver)
echo 1433
;;
*)
echo "~~~~~ please supply JDBC port for your repository ~~~~~"
esac
else
echo $REPO_PORT
fi
}
if [[ $REPO_JDBC_URL == "default" ]]; then
REPO_PORT=$( resolvePort )
case $REPO_DATABASE_TYPE in
mariadb)
echo "jdbc:mariadb://$REPO_HOST:$REPO_PORT/$REPO_DATABASE?characterEncoding=utf8"
;;
mysql)
echo "jdbc:mysql://$REPO_HOST:$REPO_PORT/$REPO_DATABASE?characterEncoding=utf8"
;;
oracle)
echo "jdbc:oracle:thin:@$REPO_HOST:$REPO_PORT/xe"
;;
postgresql)
echo "jdbc:postgresql://$REPO_HOST:$REPO_PORT/$REPO_DATABASE"
;;
sqlserver)
echo "jdbc:sqlserver://$REPO_HOST:$REPO_PORT;database=$REPO_DATABASE"
;;
*)
echo "~~~~~ please supply JDBC URL for your repository ~~~~~"
esac
else
echo $REPO_JDBC_URL
fi
You can’t perform that action at this time.