From 69a38d189545841161234a5f62313f45f40932c8 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 14 Sep 2013 12:07:04 +0200 Subject: [PATCH] added cubrid_pdo to travis --- .travis.yml | 19 +------------------ tests/unit/data/cubrid-solo.rb | 5 ----- tests/unit/data/travis/cubrid-setup.sh | 32 ++++++++++++++++++++++++++++++++ tests/unit/data/travis/cubrid-solo.rb | 5 +++++ 4 files changed, 38 insertions(+), 23 deletions(-) delete mode 100644 tests/unit/data/cubrid-solo.rb create mode 100644 tests/unit/data/travis/cubrid-setup.sh create mode 100644 tests/unit/data/travis/cubrid-solo.rb diff --git a/.travis.yml b/.travis.yml index 8b0153e..3a38d05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,24 +13,7 @@ before_script: - composer require satooshi/php-coveralls 0.6.* - mysql -e 'CREATE DATABASE yiitest;'; - psql -U postgres -c 'CREATE DATABASE yiitest;'; - # - # install CUBRID DBMS https://github.com/CUBRID/node-cubrid/blob/056e734ce36bb3fd25f100c983beb3947e899c1c/.travis.yml - - sudo hostname localhost - # Update OS before installing prerequisites. - - sudo apt-get update - # Install Chef Solo prerequisites. - - sudo apt-get install ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential ssl-cert - # Install Chef Solo. - # Chef Solo 11.4.4 is broken, so install a previous version. - # The bug is planned to be fixed in 11.4.5 which haven't been released yet. - - sudo gem install --version '<11.4.4' chef --no-rdoc --no-ri - # Make sure the target directory for cookbooks exists. - - mkdir -p /tmp/chef-solo - # Prepare a file with runlist for Chef Solo. - - echo '{"cubrid":{"version":"'$CUBRID_VERSION'"},"run_list":["cubrid::demodb"]}' > cubrid_chef.json - # Install CUBRID via Chef Solo. Download all cookbooks from a remote URL. - - sudo chef-solo -c tests/unit/data/cubrid-solo.rb -j cubrid_chef.json -r http://sourceforge.net/projects/cubrid/files/CUBRID-Demo-Virtual-Machines/Vagrant/chef-cookbooks.tar.gz/download - - sudo pecl install pdo_cubrid + - tests/unit/data/travis/cubrid-setup.sh script: - phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose diff --git a/tests/unit/data/cubrid-solo.rb b/tests/unit/data/cubrid-solo.rb deleted file mode 100644 index f5f0004..0000000 --- a/tests/unit/data/cubrid-solo.rb +++ /dev/null @@ -1,5 +0,0 @@ -file_cache_path "/tmp/chef-solo" -data_bag_path "/tmp/chef-solo/data_bags" -encrypted_data_bag_secret "/tmp/chef-solo/data_bag_key" -cookbook_path [ "/tmp/chef-solo/cookbooks" ] -role_path "/tmp/chef-solo/roles" \ No newline at end of file diff --git a/tests/unit/data/travis/cubrid-setup.sh b/tests/unit/data/travis/cubrid-setup.sh new file mode 100644 index 0000000..af007ff --- /dev/null +++ b/tests/unit/data/travis/cubrid-setup.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# +# install CUBRID DBMS https://github.com/CUBRID/node-cubrid/blob/056e734ce36bb3fd25f100c983beb3947e899c1c/.travis.yml + +sudo hostname localhost +# Update OS before installing prerequisites. +sudo apt-get update +# Install Chef Solo prerequisites. +sudo apt-get install ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential ssl-cert +# Install Chef Solo. +# Chef Solo 11.4.4 is broken, so install a previous version. +# The bug is planned to be fixed in 11.4.5 which haven't been released yet. +sudo gem install --version '<11.4.4' chef --no-rdoc --no-ri +# Make sure the target directory for cookbooks exists. +mkdir -p /tmp/chef-solo +# Prepare a file with runlist for Chef Solo. +echo '{"cubrid":{"version":"'$CUBRID_VERSION'"},"run_list":["cubrid::demodb"]}' > cubrid_chef.json +# Install CUBRID via Chef Solo. Download all cookbooks from a remote URL. +sudo chef-solo -c tests/unit/data/travis/cubrid-solo.rb -j cubrid_chef.json -r http://sourceforge.net/projects/cubrid/files/CUBRID-Demo-Virtual-Machines/Vagrant/chef-cookbooks.tar.gz/download + + +install_pdo_cubrid() { + wget "http://pecl.php.net/get/PDO_CUBRID-9.1.0.0003.tgz" && + tar -zxf "PDO_CUBRID-9.1.0.0003.tgz" && + sh -c "cd PDO_CUBRID-9.1.0.0003 && phpize && ./configure && make && sudo make install" + + echo "extension=pdo_cubrid.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + + return $? +} + +install_pdo_cubrid > ~/pdo_cubrid.log || ( echo "=== PDO CUBRID BUILD FAILED ==="; cat ~/pdo_cubrid.log ) \ No newline at end of file diff --git a/tests/unit/data/travis/cubrid-solo.rb b/tests/unit/data/travis/cubrid-solo.rb new file mode 100644 index 0000000..f5f0004 --- /dev/null +++ b/tests/unit/data/travis/cubrid-solo.rb @@ -0,0 +1,5 @@ +file_cache_path "/tmp/chef-solo" +data_bag_path "/tmp/chef-solo/data_bags" +encrypted_data_bag_secret "/tmp/chef-solo/data_bag_key" +cookbook_path [ "/tmp/chef-solo/cookbooks" ] +role_path "/tmp/chef-solo/roles" \ No newline at end of file