Do not tax travis with full pull request smoking
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 10_before_install.bash
CommitLineData
b58ecb01 1#!/bin/bash
2
3source maint/travis-ci_scripts/common.bash
4if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi
5
6if [[ -n "$BREWVER" ]] ; then
7 # .travis.yml already restricts branches to master, topic/* and smoke/*
8 # do some extra short-circuiting here
9
10 # when smoking master do not attempt bleadperl (not release-critical)
e0824081 11 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
12 echo_err "$(tstamp) pull-request smoking with custom perl compilation requested - bailing out"
13 export SHORT_CIRCUIT_SMOKE=1
14 elif [[ "$TRAVIS_BRANCH" = "master" ]] && [[ "$BREWVER" = "blead" ]]; then
b58ecb01 15 echo_err "$(tstamp) master branch is not smoked with bleadperl - bailing out"
16 export SHORT_CIRCUIT_SMOKE=1
17 # on topic/ branches test only with travis perls
18 elif [[ "$TRAVIS_BRANCH" =~ "topic/" ]]; then
19 echo_err "$(tstamp) non-smoke branch and custom perl compilation requested - bailing out"
20 export SHORT_CIRCUIT_SMOKE=1
21 fi
22
23 if [[ -n "$SHORT_CIRCUIT_SMOKE" ]]; then
24 sleep 20 # give the console time to attach, otherwise it hangs
25 return # this is like an `exit 0` in sourcing
26 fi
27fi
28
29# different boxes we run on may have different amount of hw threads
30# hence why we need to query
31# result is 1.5 times the physical threads
32export NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 ))
33
34if [[ "$CLEANTEST" != "true" ]]; then
35### apt-get invocation - faster to grab everything at once
36 #
37 # FIXME these debconf lines should automate the firebird config but do not :(((
38 sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/enabled\tboolean\ttrue" | debconf-set-selections'
39 sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/sysdba_password/new_password\tpassword\t123" | debconf-set-selections'
40
41 APT_PACKAGES="memcached firebird2.5-super firebird2.5-dev expect"
42 run_or_err "Installing packages ($APT_PACKAGES)" "sudo apt-get install --allow-unauthenticated -y $APT_PACKAGES"
43
44### config memcached
45 export DBICTEST_MEMCACHED=127.0.0.1:11211
46
47### config mysql
48 run_or_err "Creating MySQL TestDB" "mysql -e 'create database dbic_test;'"
49 export DBICTEST_MYSQL_DSN='dbi:mysql:database=dbic_test;host=127.0.0.1'
50 export DBICTEST_MYSQL_USER=root
51
52### config pg
53 run_or_err "Creating PostgreSQL TestDB" "psql -c 'create database dbic_test;' -U postgres"
54 export DBICTEST_PG_DSN='dbi:Pg:database=dbic_test;host=127.0.0.1'
55 export DBICTEST_PG_USER=postgres
56
57### conig firebird
58 # poor man's deb config
59 EXPECT_FB_SCRIPT='
60 spawn dpkg-reconfigure --frontend=text firebird2.5-super
61 expect "Enable Firebird server?"
62 send "\177\177\177\177yes\r"
63 expect "Password for SYSDBA"
64 send "123\r"
65 sleep 1
66 wait
67 sleep 1
68 '
69 run_or_err "Re-configuring Firebird" "
70 sync
71 DEBIAN_FRONTEND=text sudo expect -c '$EXPECT_FB_SCRIPT'
72 sleep 1
73 sync
74 # restart the server for good measure
75 sudo /etc/init.d/firebird2.5-super stop || true
76 sleep 1
77 sync
78 sudo /etc/init.d/firebird2.5-super start
79 sleep 1
80 sync
81 "
82
83 # creating testdb
84 # FIXME - this step still fails from time to time >:(((
85 # has to do with the FB reconfiguration I suppose
86 # for now if it fails - simply skip FB testing
87 if run_or_err "Creating Firebird TestDB" \
88 "echo \"CREATE DATABASE '/var/lib/firebird/2.5/data/dbic_test.fdb';\" | sudo isql-fb -u sysdba -p 123"
89 then
90 export DBICTEST_FIREBIRD_DSN=dbi:Firebird:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb
91 export DBICTEST_FIREBIRD_USER=SYSDBA
92 export DBICTEST_FIREBIRD_PASS=123
93
94 export DBICTEST_FIREBIRD_INTERBASE_DSN=dbi:InterBase:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb
95 export DBICTEST_FIREBIRD_INTERBASE_USER=SYSDBA
96 export DBICTEST_FIREBIRD_INTERBASE_PASS=123
97 fi
98
99### oracle
100 # FIXME: todo
101 #DBICTEST_ORA_DSN=dbi:Oracle:host=localhost;sid=XE
102 #DBICTEST_ORA_USER=dbic_test
103 #DBICTEST_ORA_PASS=123
104 #DBICTEST_ORA_EXTRAUSER_DSN=dbi:Oracle:host=localhost;sid=XE
105 #DBICTEST_ORA_EXTRAUSER_USER=dbic_test_extra
106 #DBICTEST_ORA_EXTRAUSER_PASS=123
107 #ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
108fi