Skip to content

Commit

Permalink
Move common definitions to common.sh
Browse files Browse the repository at this point in the history
Source common.sh into other travis-ci shell scripts.
  • Loading branch information
mloskot committed Feb 28, 2013
1 parent 59d9414 commit 5fa38e2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
14 changes: 3 additions & 11 deletions bin/ci/before_install.sh
Expand Up @@ -2,15 +2,9 @@
# Run before_intsall actions for SOCI build at travis-ci.org
# Mateusz Loskot <mateusz@loskot.net>, 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
Expand All @@ -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
Expand All @@ -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
6 changes: 1 addition & 5 deletions bin/ci/before_script.sh
Expand Up @@ -2,11 +2,7 @@
# Run before_script actions for SOCI build at travis-ci.org
# Mateusz Loskot <mateusz@loskot.net>, 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
Expand Down
14 changes: 14 additions & 0 deletions bin/ci/common.sh
@@ -0,0 +1,14 @@
#!/bin/bash
# Common definitions used by SOCI build scripts at travis-ci.org
# Mateusz Loskot <mateusz@loskot.net>, 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
8 changes: 1 addition & 7 deletions bin/ci/script.sh
Expand Up @@ -2,13 +2,7 @@
# Run script actions for SOCI build at travis-ci.org
# Mateusz Loskot <mateusz@loskot.net>, 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
Expand Down

0 comments on commit 5fa38e2

Please sign in to comment.