diff --git a/bin/ci/before_install.sh b/bin/ci/before_install.sh index 3886f4312..e34d5e2dc 100755 --- a/bin/ci/before_install.sh +++ b/bin/ci/before_install.sh @@ -2,15 +2,9 @@ # Run before_intsall actions for SOCI build at travis-ci.org # Mateusz Loskot , http://github.com/SOCI # -set -e -if [[ "$TRAVIS" != "true" ]] ; then - echo "Running this script makes no sense outside of travis-ci.org" - exit 1 -fi -tmstamp() { echo -n "[$(date '+%H:%M:%S')]" ; } - +source ./bin/ci/common.sh # Install dependencies -echo "$(tmstamp) before_install::apt-get starting $(date)" +echo "$(tmstamp) *** before_install::apt-get starting $(date) ***" wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O - | sudo apt-key add - sudo bash -c 'echo "deb https://oss.oracle.com/debian unstable main non-free" >> /etc/apt/sources.list' sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192 @@ -20,7 +14,7 @@ sudo apt-get install -qq \ libmyodbc unixodbc-dev odbc-postgresql \ firebird2.5-super firebird2.5-dev \ oracle-xe-client -echo "$(tmstamp) before_install::apt-get finished $(date)" +echo "$(tmstamp) *** before_install::apt-get finished $(date) ***" # Configure Firebird # See: Non-interactive setup for travis-ci.org # http://tech.groups.yahoo.com/group/firebird-support/message/120883 @@ -30,5 +24,3 @@ cat /etc/default/firebird2.5 | grep ENABLE_FIREBIRD_SERVER sudo service firebird2.5-super start # Configure ODBC sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini -# Confgure oracle -export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client diff --git a/bin/ci/before_script.sh b/bin/ci/before_script.sh index 445d70f85..d4ac28a43 100755 --- a/bin/ci/before_script.sh +++ b/bin/ci/before_script.sh @@ -2,11 +2,7 @@ # Run before_script actions for SOCI build at travis-ci.org # Mateusz Loskot , http://github.com/SOCI # -set -e -if [[ "$TRAVIS" != "true" ]] ; then - echo "Running this script makes no sense outside of travis-ci.org" - exit 1 -fi +source ./bin/ci/common.sh # Create local databases # MySQL (service provided) mysql --version diff --git a/bin/ci/common.sh b/bin/ci/common.sh new file mode 100644 index 000000000..83b0017fd --- /dev/null +++ b/bin/ci/common.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Common definitions used by SOCI build scripts at travis-ci.org +# Mateusz Loskot , http://github.com/SOCI +# +set -e + +if [[ "$TRAVIS" != "true" ]] ; then + echo "Running this script makes no sense outside of travis-ci.org" + exit 1 +fi +# Functions +tmstamp() { echo -n "[$(date '+%H:%M:%S')]" ; } +# Environment +export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client diff --git a/bin/ci/script.sh b/bin/ci/script.sh index 68b87302e..5c78f864e 100755 --- a/bin/ci/script.sh +++ b/bin/ci/script.sh @@ -2,13 +2,7 @@ # Run script actions for SOCI build at travis-ci.org # Mateusz Loskot , http://github.com/SOCI # -set -e -if [[ "$TRAVIS" != "true" ]] ; then - echo "Running this script makes no sense outside of travis-ci.org" - exit 1 -fi - -export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client +source ./bin/ci/common.sh # Build SOCI using CMake (primary build configuration) mkdir -p src/_build cd src/_build