Base for a static organization website

.travis.yml 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. language: php
  2. php:
  3. - 5.3
  4. - 5.4
  5. - 5.5
  6. env:
  7. - CAKE_VERSION=2.3.10 DB=mysql
  8. - CAKE_VERSION=2.3.10 DB=pgsql
  9. - CAKE_VERSION=2.4.10 DB=mysql
  10. - CAKE_VERSION=2.4.10 DB=pgsql
  11. - CAKE_VERSION=2.6 DB=mysql
  12. - CAKE_VERSION=2.6 DB=pgsql
  13. install:
  14. - git clone git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
  15. - cp -R ../debug_kit plugins/DebugKit
  16. - chmod -R 777 ../cakephp/app/tmp
  17. - sh -c "composer global require 'phpunit/phpunit=3.7.33'"
  18. - sh -c "ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ../cakephp/vendors/PHPUnit"
  19. before_script:
  20. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  21. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  22. - set +H
  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. 'pgsql' => array(
  32. 'datasource' => 'Database/Postgres',
  33. 'host' => '127.0.0.1',
  34. 'login' => 'postgres',
  35. 'database' => 'cakephp_test',
  36. 'schema' => array(
  37. 'default' => 'public',
  38. 'test' => 'public'
  39. )
  40. )
  41. );
  42. public \$default = array(
  43. 'persistent' => false,
  44. 'host' => '',
  45. 'login' => '',
  46. 'password' => '',
  47. 'database' => 'cakephp_test',
  48. 'prefix' => ''
  49. );
  50. public \$test = array(
  51. 'persistent' => false,
  52. 'host' => '',
  53. 'login' => '',
  54. 'password' => '',
  55. 'database' => 'cakephp_test',
  56. 'prefix' => ''
  57. );
  58. public function __construct() {
  59. \$db = 'mysql';
  60. if (!empty(\$_SERVER['DB'])) {
  61. \$db = \$_SERVER['DB'];
  62. }
  63. foreach (array('default', 'test') as \$source) {
  64. \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
  65. if (is_array(\$config['database'])) {
  66. \$config['database'] = \$config['database'][\$source];
  67. }
  68. if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
  69. \$config['schema'] = \$config['schema'][\$source];
  70. }
  71. \$this->{\$source} = \$config;
  72. }
  73. }
  74. }" > ../cakephp/app/Config/database.php
  75. script:
  76. - ./lib/Cake/Console/cake test DebugKit AllDebugKit --stderr
  77. notifications:
  78. email: false