language: erlang
otp_release:
  - 19.2
  - 19.0
python:
  - "2.7"
rvm:
  - 1.9.3
before_install:
  - sudo apt-get update
# travis default image has: make autoconf automake libtool g++ git perl python python-dev
  - sudo apt-get install default-jdk php5 libboost-system-dev libboost-thread-dev libboost-dev libgmp3-dev uuid-dev
before_script:
  - kerl list installations
  - mkdir build
  - cd build
  - ../src/autogen.sh
  - ../src/configure --with-zeromq --with-cxx-backtrace --prefix=`pwd`/../install_local
  - mysql -u root -e "CREATE DATABASE cloudi_tests;"
  - mysql -u root -e "CREATE USER 'cloudi_tests'@'localhost' IDENTIFIED BY 'cloudi_tests'; GRANT ALL ON cloudi_tests.* TO cloudi_tests;"
  - psql -U postgres -c "CREATE DATABASE cloudi_tests;"
  - psql -U postgres -c "CREATE USER cloudi_tests WITH PASSWORD 'cloudi_tests'; GRANT ALL PRIVILEGES ON DATABASE cloudi_tests to cloudi_tests;"
  - gem install test-unit
script:
  - ../src/make_dev test install || ( find ../src/ -mmin 1 \( -name 'raw.log' -o -name 'cloudi.log' \) -printf '%C@ %p\n' | sort -r | cut -d ' ' -f 2 | xargs cat && exit 1 )
  - ../src/make_dev install DESTDIR=`pwd`/../install_pkgdir/
after_script:
  - make distclean
branches:
  only:
    - master
    - develop
notifications:
  irc: "chat.freenode.net#cloudi"
