.travis.yml 1.9 KB

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