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