.travis.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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/cache
  17. - mkdir ./app/tmp/cache/persistent
  18. - mkdir ./app/tmp/cache/models
  19. - chmod -R 0777 ./app/tmp
  20. - echo "<?php
  21. class DATABASE_CONFIG {
  22. private \$identities = array(
  23. 'mysql' => array(
  24. 'datasource' => 'Database/Mysql',
  25. 'host' => '0.0.0.0',
  26. 'login' => 'travis'
  27. )
  28. );
  29. public \$default = array(
  30. 'persistent' => false,
  31. 'host' => '',
  32. 'login' => '',
  33. 'password' => '',
  34. 'database' => 'cakephp_test',
  35. 'prefix' => ''
  36. );
  37. public \$test = array(
  38. 'persistent' => false,
  39. 'host' => '',
  40. 'login' => '',
  41. 'password' => '',
  42. 'database' => 'cakephp_test',
  43. 'prefix' => ''
  44. );
  45. public function __construct() {
  46. \$db = 'mysql';
  47. if (!empty(\$_SERVER['DB'])) {
  48. \$db = \$_SERVER['DB'];
  49. }
  50. foreach (array('default', 'test') as \$source) {
  51. \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
  52. if (is_array(\$config['database'])) {
  53. \$config['database'] = \$config['database'][\$source];
  54. }
  55. if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
  56. \$config['schema'] = \$config['schema'][\$source];
  57. }
  58. \$this->{\$source} = \$config;
  59. }
  60. }
  61. }" > app/Config/database.php
  62. - cd app
  63. script:
  64. - ../lib/Cake/Console/cake test Tools AllTools
  65. notifications:
  66. email: false