Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:SOCI/soci into hotfix/3.2.2_174
Conflicts: bin/ci/before_install.sh bin/ci/before_script.sh bin/ci/script.sh Closes #174
- Loading branch information
Showing
22 changed files
with
391 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,13 @@ | ||
#!/bin/bash | ||
# Run before_intsall actions for SOCI build at travis-ci.org | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
#!/bin/bash -e | ||
# Run before_install actions for SOCI build at travis-ci.org | ||
# | ||
source ./bin/ci/common.sh | ||
# Install dependencies | ||
echo "$(tmstamp) *** before_install::apt-get starting $(date) ***" | ||
#sudo apt-get install -qq apt-transport-https | ||
#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 bash -c 'echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list' | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192 | ||
sudo apt-get update -qq | ||
#if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes ia32-libs ia32-libs-multiarch fi | ||
sudo apt-get install -qq \ | ||
tar bzip2 \ | ||
libstdc++5 \ | ||
libaio1 \ | ||
libboost-dev libboost-date-time-dev \ | ||
libmyodbc odbc-postgresql \ | ||
firebird2.5-super firebird2.5-dev | ||
echo "$(tmstamp) *** before_install::apt-get finished $(date) ***" | ||
|
||
echo "$(tmstamp) *** before_install::oracle starting $(date) ***" | ||
|
||
if wget http://brzuchol.loskot.net/software/oracle/instantclient_11_2-linux-x64-mloskot.tar.bz2 ; then | ||
tar -jxf instantclient_11_2-linux-x64-mloskot.tar.bz2 | ||
sudo mkdir -p /opt | ||
sudo mv instantclient_11_2 /opt | ||
sudo ln -s ${ORACLE_HOME}/libclntsh.so.11.1 ${ORACLE_HOME}/libclntsh.so | ||
sudo ln -s ${ORACLE_HOME}/libocci.so.11.1 ${ORACLE_HOME}/libocci.so | ||
else | ||
echo "WARNING: failed to download Orcale distribution. Oracle will not be tested." | ||
fi | ||
echo "$(tmstamp) *** before_install::oracle finished $(date) ***" | ||
|
||
echo "$(tmstamp) *** before_install::db2 starting $(date) ***" | ||
echo "Running apt-get install db2exc" | ||
# deliberately verbose to test - mloskot | ||
sudo apt-get install -y db2exc | ||
echo "Running db2profile and db2rmln" | ||
sudo /bin/sh -c '. ~db2inst1/sqllib/db2profile ; $DB2DIR/cfg/db2rmln' | ||
echo "Setting up db2 users" | ||
echo -e "db2inst1\ndb2inst1" | sudo passwd db2inst1 | ||
echo -e "db2fenc1\ndb2fenc1" | sudo passwd db2fenc1 | ||
echo -e "dasusr1\ndasusr1" | sudo passwd dasusr1 | ||
echo "Configuring DB2 ODBC driver" | ||
if test `getconf LONG_BIT` = "64" ; then | ||
if test -f /home/db2inst1/sqllib/lib64/libdb2o.so ; then | ||
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib64/libdb2o.so | ||
else | ||
echo "ERROR: can't find the 64-bit DB2 ODBC library" | ||
exit 1 | ||
fi | ||
else | ||
if test -f /home/db2inst1/sqllib/lib32/libdb2.so ; then | ||
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib32/libdb2.so | ||
elif test -f /home/db2inst1/sqllib/lib/libdb2.so ; then | ||
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib/libdb2.so | ||
else | ||
echo "ERROR: can't find the 32-bit DB2 ODBC library" | ||
exit 1 | ||
fi | ||
fi | ||
echo "DB2 ODBC driver set to $DB2_ODBC_DRIVER" | ||
echo "$(tmstamp) *** before_install::db2 finished $(date) ***" | ||
|
||
echo "$(tmstamp) *** before_install::odbc starting $(date) ***" | ||
# to prevent header file conflicts, unixodbc-dev has to be installed after | ||
# db2rmln is run | ||
sudo apt-get install -qq unixodbc-dev | ||
echo "$(tmstamp) *** before_install::odbc finished $(date) ***" | ||
sudo apt-get install -qq libboost-dev libboost-date-time-dev | ||
|
||
echo "$(tmstamp) *** before_install::config starting $(date) ***" | ||
# Configure Firebird | ||
# See: Non-interactive setup for travis-ci.org | ||
# http://tech.groups.yahoo.com/group/firebird-support/message/120883 | ||
#sudo dpkg-reconfigure -f noninteractive firebird2.5-super | ||
sudo sed /ENABLE_FIREBIRD_SERVER=/s/no/yes/ -i /etc/default/firebird2.5 | ||
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 | ||
cat <<EOF | sudo odbcinst -i -d -r | ||
[DB2] | ||
Description = ODBC for DB2 | ||
Driver = $DB2_ODBC_DRIVER | ||
FileUsage = 1 | ||
Threading = 0 | ||
EOF | ||
echo "$(tmstamp) *** before_install::config finished $(date) ***" | ||
before_install="${TRAVIS_BUILD_DIR}/bin/ci/before_install_${SOCI_TRAVIS_BACKEND}.sh" | ||
[ -x ${before_install} ] && ${before_install} || echo "nothing to run" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash -e | ||
# Installs DB2 for SOCI build at travis-ci.org | ||
# | ||
# Copyright (c) 2013 Brian R. Toonen <toonen@alcf.anl.gov> | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
sudo bash -c 'echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list' | ||
sudo apt-get update -qq | ||
sudo apt-get install -y db2exc | ||
|
||
echo "Running db2profile and db2rmln" | ||
sudo /bin/sh -c '. ~db2inst1/sqllib/db2profile ; $DB2DIR/cfg/db2rmln' | ||
|
||
echo "Setting up db2 users" | ||
echo -e "db2inst1\ndb2inst1" | sudo passwd db2inst1 | ||
echo -e "db2fenc1\ndb2fenc1" | sudo passwd db2fenc1 | ||
echo -e "dasusr1\ndasusr1" | sudo passwd dasusr1 | ||
|
||
echo "Configuring DB2 ODBC driver" | ||
if test `getconf LONG_BIT` = "64" ; then | ||
if test -f /home/db2inst1/sqllib/lib64/libdb2o.so ; then | ||
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib64/libdb2o.so | ||
else | ||
echo "ERROR: can't find the 64-bit DB2 ODBC library" | ||
exit 1 | ||
fi | ||
else | ||
if test -f /home/db2inst1/sqllib/lib32/libdb2.so ; then | ||
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib32/libdb2.so | ||
elif test -f /home/db2inst1/sqllib/lib/libdb2.so ; then | ||
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib/libdb2.so | ||
else | ||
echo "ERROR: can't find the 32-bit DB2 ODBC library" | ||
exit 1 | ||
fi | ||
fi | ||
echo "DB2 ODBC driver set to $DB2_ODBC_DRIVER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -e | ||
# Install Firebird server for SOCI at travis-ci.org | ||
# | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
sudo apt-get install -qq firebird2.5-super firebird2.5-dev | ||
|
||
# Configure Firebird server | ||
# See: Non-interactive setup for travis-ci.org | ||
# http://tech.groups.yahoo.com/group/firebird-support/message/120883 | ||
#sudo dpkg-reconfigure -f noninteractive firebird2.5-super | ||
sudo sed /ENABLE_FIREBIRD_SERVER=/s/no/yes/ -i /etc/default/firebird2.5 | ||
cat /etc/default/firebird2.5 | grep ENABLE_FIREBIRD_SERVER | ||
sudo service firebird2.5-super start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash -e | ||
# Install ODBC libraries for SOCI at travis-ci.org | ||
# | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
sudo apt-get install -qq \ | ||
tar bzip2 \ | ||
unixodbc-dev \ | ||
libmyodbc odbc-postgresql | ||
|
||
sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -e | ||
# Install Oracle client libraries for SOCI at travis-ci.org | ||
# | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
sudo apt-get install -qq tar bzip2 libaio1 | ||
|
||
wget http://brzuchol.loskot.net/software/oracle/instantclient_11_2-linux-x64-mloskot.tar.bz2 | ||
tar -jxf instantclient_11_2-linux-x64-mloskot.tar.bz2 | ||
sudo mkdir -p /opt | ||
sudo mv instantclient_11_2 /opt | ||
sudo ln -s ${ORACLE_HOME}/libclntsh.so.11.1 ${ORACLE_HOME}/libclntsh.so | ||
sudo ln -s ${ORACLE_HOME}/libocci.so.11.1 ${ORACLE_HOME}/libocci.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
# Run before_script actions for SOCI build at travis-ci.org | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
source ./bin/ci/common.sh | ||
# Create local databases | ||
echo "$(tmstamp) *** before_script::createdb starting $(date) ***" | ||
# MySQL (service provided) | ||
mysql --version | ||
mysql -e 'create database soci_test;' | ||
# PostgreSQL (service provided) | ||
psql --version | ||
psql -c 'create database soci_test;' -U postgres | ||
# Firebird (installed manually, see before_install.sh) | ||
isql-fb -z -q -i /dev/null # --version | ||
echo 'CREATE DATABASE "LOCALHOST:/tmp/soci_test.fdb" PAGE_SIZE = 16384;' > /tmp/create_soci_test.sql | ||
isql-fb -u SYSDBA -p masterkey -i /tmp/create_soci_test.sql -q | ||
cat /tmp/create_soci_test.sql | ||
sudo -u db2inst1 -i db2 "CREATE DATABASE SOCITEST" | ||
sudo -u db2inst1 -i db2 "ACTIVATE DATABASE SOCITEST" | ||
echo "$(tmstamp) *** before_script::createdb finished $(date) ***" | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
before_script="${TRAVIS_BUILD_DIR}/bin/ci/before_script_${SOCI_TRAVIS_BACKEND}.sh" | ||
[ -x ${before_script} ] && ${before_script} || echo "nothing to run" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -e | ||
# Sets up environment for SOCI backend DB2 at travis-ci.org | ||
# | ||
# Copyright (c) 2013 Brian R. Toonen <toonen@alcf.anl.gov> | ||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
sudo -u db2inst1 -i db2 "CREATE DATABASE SOCITEST" | ||
sudo -u db2inst1 -i db2 "ACTIVATE DATABASE SOCITEST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -e | ||
# Configure Firebird database for SOCI build at travis-ci.org | ||
# | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
isql-fb -z -q -i /dev/null # --version | ||
echo 'CREATE DATABASE "LOCALHOST:/tmp/soci_test.fdb" PAGE_SIZE = 16384;' > /tmp/create_soci_test.sql | ||
isql-fb -u SYSDBA -p masterkey -i /tmp/create_soci_test.sql -q | ||
cat /tmp/create_soci_test.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -e | ||
# Sets up environment for SOCI backend MySQL at travis-ci.org | ||
# | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
mysql --version | ||
mysql -e 'create database soci_test;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -e | ||
# Sets up environment for SOCI backend ODBC at travis-ci.org | ||
# | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
mysql --version | ||
mysql -e 'create database soci_test;' | ||
psql --version | ||
psql -c 'create database soci_test;' -U postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -e | ||
# Sets up environment for SOCI backend PostgreSQL at travis-ci.org | ||
# | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh | ||
|
||
psql --version | ||
psql -c 'create database soci_test;' -U postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,36 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
# Common definitions used by SOCI build scripts at travis-ci.org | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
set -e | ||
|
||
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net> | ||
# | ||
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 | ||
NUMTHREADS=4 | ||
# | ||
TCI_NUMTHREADS=2 | ||
if [[ -f /sys/devices/system/cpu/online ]]; then | ||
# Calculates 1.5 times physical threads | ||
NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 )) | ||
TCI_NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 )) | ||
fi | ||
export NUMTHREADS | ||
export ORACLE_HOME=/opt/instantclient_11_2 | ||
export LD_LIBRARY_PATH=${ORACLE_HOME}:${LD_LIBRARY_PATH} | ||
# | ||
# Functions | ||
# | ||
tmstamp() | ||
{ | ||
echo -n "[$(date '+%H:%M:%S')]" ; | ||
} | ||
|
||
run_make() | ||
{ | ||
[ $TCI_NUMTHREADS -gt 0 ] && make -j $TCI_NUMTHREADS ] || make | ||
} | ||
|
||
run_test() | ||
{ | ||
ctest -V --output-on-failure . | ||
} |
Oops, something went wrong.