Base for a static organization website

.travis.yml 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. language: php
  2. php:
  3. - 5.3
  4. - 5.4
  5. - 5.5
  6. - 5.6
  7. env:
  8. - DB=mysql
  9. services:
  10. - memcached
  11. matrix:
  12. fast_finish: true
  13. include:
  14. - php: 5.4
  15. env: DB=pgsql
  16. - php: 5.4
  17. env: DB=sqlite
  18. - php: 5.4
  19. env: PHPCS=1
  20. before_script:
  21. - sh -c "composer global require 'phpunit/phpunit=3.7.33'"
  22. - sh -c "ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ./vendors/PHPUnit"
  23. - sudo locale-gen de_DE
  24. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  25. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
  26. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi"
  27. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  28. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
  29. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
  30. - chmod -R 777 ./app/tmp
  31. - sudo apt-get install lighttpd
  32. - sh -c "if [ '$PHPCS' = '1' ]; then composer global require 'cakephp/cakephp-codesniffer:1.*'; fi"
  33. - sh -c "if [ '$PHPCS' = '1' ]; then ~/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/cakephp/cakephp-codesniffer; fi"
  34. - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  35. - phpenv rehash
  36. - set +H
  37. - echo "<?php
  38. class DATABASE_CONFIG {
  39. private \$identities = array(
  40. 'mysql' => array(
  41. 'datasource' => 'Database/Mysql',
  42. 'host' => '0.0.0.0',
  43. 'login' => 'travis'
  44. ),
  45. 'pgsql' => array(
  46. 'datasource' => 'Database/Postgres',
  47. 'host' => '127.0.0.1',
  48. 'login' => 'postgres',
  49. 'database' => 'cakephp_test',
  50. 'schema' => array(
  51. 'default' => 'public',
  52. 'test' => 'public',
  53. 'test2' => 'test2',
  54. 'test_database_three' => 'test3'
  55. )
  56. ),
  57. 'sqlite' => array(
  58. 'datasource' => 'Database/Sqlite',
  59. 'database' => array(
  60. 'default' => ':memory:',
  61. 'test' => ':memory:',
  62. 'test2' => '/tmp/cakephp_test2.db',
  63. 'test_database_three' => '/tmp/cakephp_test3.db'
  64. ),
  65. )
  66. );
  67. public \$default = array(
  68. 'persistent' => false,
  69. 'host' => '',
  70. 'login' => '',
  71. 'password' => '',
  72. 'database' => 'cakephp_test',
  73. 'prefix' => ''
  74. );
  75. public \$test = array(
  76. 'persistent' => false,
  77. 'host' => '',
  78. 'login' => '',
  79. 'password' => '',
  80. 'database' => 'cakephp_test',
  81. 'prefix' => ''
  82. );
  83. public \$test2 = array(
  84. 'persistent' => false,
  85. 'host' => '',
  86. 'login' => '',
  87. 'password' => '',
  88. 'database' => 'cakephp_test2',
  89. 'prefix' => ''
  90. );
  91. public \$test_database_three = array(
  92. 'persistent' => false,
  93. 'host' => '',
  94. 'login' => '',
  95. 'password' => '',
  96. 'database' => 'cakephp_test3',
  97. 'prefix' => ''
  98. );
  99. public function __construct() {
  100. \$db = 'mysql';
  101. if (!empty(\$_SERVER['DB'])) {
  102. \$db = \$_SERVER['DB'];
  103. }
  104. foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) {
  105. \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
  106. if (is_array(\$config['database'])) {
  107. \$config['database'] = \$config['database'][\$source];
  108. }
  109. if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
  110. \$config['schema'] = \$config['schema'][\$source];
  111. }
  112. \$this->{\$source} = \$config;
  113. }
  114. }
  115. }" > app/Config/database.php
  116. script:
  117. - sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi"
  118. - sh -c "if [ '$PHPCS' = '1' ]; then ~/.composer/vendor/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
  119. notifications:
  120. email: false