2

I tried the configuration below and attempted to run unit tests that connect demodb database on port 30000 or 33000 with no success.

language: php

php:
  - 5.4
  - 5.5

install:
  - echo 'yes' | sudo add-apt-repository ppa:cubrid/cubrid
  - sudo apt-get update
  - sudo apt-get install cubrid
  - /etc/profile.d/cubrid.sh
  - sudo apt-get install cubrid-demodb
  - sudo apt-get install php5-cubrid
  - echo '/opt/cubrid/' | pecl install pdo_cubrid
  - /etc/profile.d/cubrid.sh

script: phpunit --group travis

Connection string looks like this: cubrid:host=localhost;port=30000;dbname=demodb. Any ideas how to configure CUBRID database to run on Travis CI? Did someone managed that?

marcio
  • 10,002
  • 11
  • 54
  • 83

2 Answers2

1

Yes, refer to node-cubrid Node.js module for CUBRID.

Though there are various ways to install CUBRID on Ubuntu (used by Travis workers), I prefer to install it via Chef provisioner using cubrid-cookbook. If you check the .travis.yml of the node-cubrid module, you will notice several things:

  1. It runs Travis tests in various CUBRID environments (CUBRID 8.4.1, 8.4.3, 8.4.4, 9.1.0) and Node.js (0.6, 0.8, 0.10).
  2. CUBRID Server, once installed, can listen to only an IPv4 address, thus the script sets the hostname to localhost. Travis worker defaults to an IPv6 address.
  3. Install deps for Chef (Ruby and related stuff).
  4. Install Chef Ruby gem.
  5. Prepare the CUBRID run list for Chef.
  6. Start up Chef provisioner.

Thus, you can install various versions of CUBRID and run tests in Travis CI.

esengineer
  • 9,514
  • 7
  • 45
  • 69
0

It seems I was unable to connect to CUBRID within Travis VM. I had to point hostname to 127.0.0.1 just like @Eye did on this github thread.

Travis install looks like this now:

install:
  - echo 'yes' | sudo add-apt-repository ppa:cubrid/cubrid
  - sudo apt-get update
  - sudo apt-get install cubrid
  - /etc/profile.d/cubrid.sh
  - sudo apt-get install cubrid-demodb
  - sudo apt-get install php5-cubrid
  - cat /etc/profile.d/cubrid.sh
  - echo '/opt/cubrid/' | pecl install pdo_cubrid
  - /etc/profile.d/cubrid.sh
  - hostname | sed 's/^/127.0.0.1 /g' | cat - /etc/hosts > /tmp/etchoststemp && sudo mv /tmp/etchoststemp /etc/hosts --force

One way or another, bounty goes to @Eye!

marcio
  • 10,002
  • 11
  • 54
  • 83
  • Thank you for the bounty. My first one! ^_^ In fact, other PHP framework maintainers also use similar steps like you have, i.e. via the Launchpad repository. The reason I don't do that is only the fact that not all CUBRID versions are available on time at Launchpad. – esengineer Dec 27 '13 at 02:11
  • 1
    Your cookbook approach is much better, picked this one because I only had to add one line of setup instead of redo it. CRUBRID is awesome! – marcio Dec 27 '13 at 03:07