change to install

4 views
Skip to first unread message

John Iodice

unread,
Mar 15, 2013, 10:09:26 AM3/15/13
to Ryan, strategies...@googlegroups.com, cbil >> 'cbil'
Ryan,

Your change (below) breaks PostgreSQL installs, which don't, in general, have $ORACLE_HOME defined. Before making that requirement, we have to check that we're using Oracle (by looking at the "platform" attribute of the <appDb> or <userDb> elements of model-config, or the dbVendor property in the gus.config file).

Until we can be that slick, can we just back this change out?

Thanks,
John


On Thu, Mar 14, 2013 at 5:43 PM, <rdoh...@pcbi.upenn.edu> wrote:
Author: rdoherty
Date: 2013-03-14 17:43:00 -0400 (Thu, 14 Mar 2013)
New Revision: 11648

Added:
   install/trunk/bin/installOracleDriver.sh
Log:
convenience script for copying Oracle driver from dev server onto UNIX-based dev client machines

Added: install/trunk/bin/installOracleDriver.sh
===================================================================
--- install/trunk/bin/installOracleDriver.sh                            (rev 0)
+++ install/trunk/bin/installOracleDriver.sh    2013-03-14 21:43:00 UTC (rev 11648)
@@ -0,0 +1,74 @@
+#!/bin/bash
+###########################################################################
+##
+## This script is meant to be run on UNIX-based development clients to copy
+## the appropriate Oracle driver from a dev server into all the locations
+## required for EuPathDB software development.  Currently those are as
+## follows:
+##    1. $ORACLE_HOME/jdbc/lib
+##    2. $GUS_HOME/lib/java/db_driver
+##    3. The appropriate location in your local maven repository
+##
+###########################################################################
+## constants related to this script (subject to change)
+###########################################################################
+
+jarFileName=ojdbc5.jar
+serverOracleHome=/u01/app/oracle/product/11.2.0.3/db_1
+artifactId=ojdbc5
+version=11.2.0.3
+
+###########################################################################
+
+set -e
+
+function getDriver {
+
+  # variables created by the constants above (may be subject to change but less likely)
+  remoteLogin=$1
+  remoteLoc=${remoteLogin}:$serverOracleHome/jdbc/lib/$jarFileName
+  localLoc=$HOME/$jarFileName
+  gusLibDriverDir=$GUS_HOME/lib/java/db_driver
+  previousVersionPattern=ojdbc*.jar
+  oraHomeLib=$ORACLE_HOME/jdbc/lib
+
+  # copy file from server to local temp location
+  echo "Transferring file from ${remoteLoc}"
+  scp ${remoteLoc} ${localLoc}
+
+  # copy into local maven repository
+  echo "Installing driver into local maven repository"
+  mvn install:install-file -DgroupId=com.oracle -DartifactId=${artifactId} \
+      -Dversion=${version} -Dpackaging=jar -Dfile=${localLoc} -DgeneratePom=true
+
+  # copy into GUS_HOME/lib and remove previous driver versions
+  echo "Removing the following drivers from GUS HOME:"
+  ls -1 ${gusLibDriverDir}/${previousVersionPattern} 2>/dev/null || echo "  No old drivers found."
+  rm -f ${gusLibDriverDir}/${previousVersionPattern}
+  echo "Installing driver into ${gusLibDriverDir}"
+  mv ${localLoc} ${gusLibDriverDir}
+
+  # copy into user's ORACLE_HOME
+  if [ -e $oraHomeLib/$jarFileName ]; then
+    echo "Oracle driver by name $jarFileName already exists in $oraHomeLib"
+  else
+    if [ -d $oraHomeLib ]; then
+      echo "Installing driver into $oraHomeLib"
+      cp ${gusLibDriverDir}/$jarFileName $oraHomeLib
+    else
+      echo "WARNING: driver could not be copied into \$ORACLE_HOME/jdbc/lib"
+      echo "   Please check your environment variable and ensure the directory exists."
+    fi
+  fi
+
+  echo "Done."
+}
+
+if [ "$#" != "1" ]; then
+  echo "USAGE: installOracleDriver.sh [<user>@]<server>"
+  echo "    user  : existing user on the remote EuPathDB server"
+  echo "    server: EuPathDB server from which to retrieve the Oracle driver"
+  exit 0
+fi
+
+getDriver $1


Property changes on: install/trunk/bin/installOracleDriver.sh
___________________________________________________________________
Added: svn:executable
   + *

_______________________________________________
Gus-commits mailing list
Gus-c...@mail.pcbi.upenn.edu
http://mail.pcbi.upenn.edu/mailman/listinfo/gus-commits

Reply all
Reply to author
Forward
0 new messages