.travis.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. language: php
  2. php:
  3. - 5.3
  4. - 5.4
  5. env:
  6. - CAKE_VERSION=master
  7. - CAKE_VERSION=2.4
  8. before_script:
  9. - git clone --depth 1 --branch $CAKE_VERSION git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp
  10. - rm -R app
  11. - git clone --depth 1 git://github.com/dereuromark/tools-app app && cd app && git checkout master
  12. - cd ..
  13. - cp -R ../tools plugins/Tools
  14. - sh -c "if [ 'mysql' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  15. - mkdir ./app/tmp
  16. - mkdir ./app/tmp/logs
  17. - mkdir ./app/tmp/cache
  18. - mkdir ./app/tmp/cache/persistent
  19. - mkdir ./app/tmp/cache/models
  20. - chmod -R 0777 ./app/tmp
  21. - echo "<?php
  22. class DATABASE_CONFIG {
  23. private \$identities = array(
  24. 'mysql' => array(
  25. 'datasource' => 'Database/Mysql',
  26. 'host' => '0.0.0.0',
  27. 'login' => 'travis'
  28. )
  29. );
  30. public \$default = array(
  31. 'persistent' => false,
  32. 'host' => '',
  33. 'login' => '',
  34. 'password' => '',
  35. 'database' => 'cakephp_test',
  36. 'prefix' => ''
  37. );
  38. public \$test = array(
  39. 'persistent' => false,
  40. 'host' => '',
  41. 'login' => '',
  42. 'password' => '',
  43. 'database' => 'cakephp_test',
  44. 'prefix' => ''
  45. );
  46. public function __construct() {
  47. \$db = 'mysql';
  48. if (!empty(\$_SERVER['DB'])) {
  49. \$db = \$_SERVER['DB'];
  50. }
  51. foreach (array('default', 'test') as \$source) {
  52. \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
  53. if (is_array(\$config['database'])) {
  54. \$config['database'] = \$config['database'][\$source];
  55. }
  56. if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
  57. \$config['schema'] = \$config['schema'][\$source];
  58. }
  59. \$this->{\$source} = \$config;
  60. }
  61. }
  62. }" > app/Config/database.php
  63. - cd app
  64. script:
  65. - ../lib/Cake/Console/cake test Tools AllTools
  66. notifications:
  67. email: false