mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-02 00:49:21 +03:00
add configs for travis-ci
This commit is contained in:
parent
6943f40bae
commit
2f411db01d
47
.travis.yml
Normal file
47
.travis.yml
Normal file
|
@ -0,0 +1,47 @@
|
|||
language: php
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
|
||||
before_script:
|
||||
# export virtual display
|
||||
- export DISPLAY=:99
|
||||
|
||||
# change application working folders for write access
|
||||
- chmod -R 0777 ./tmp
|
||||
- chmod -R 0777 ./uploads
|
||||
- chmod -R 0777 ./templates/cache/
|
||||
- chmod -R 0777 ./templates/compiled/
|
||||
- rm -rf install/
|
||||
|
||||
# install required PHP stuff
|
||||
- sudo apt-get install php5 php5-cli php5-mysql php5-mcrypt php5-xsl php5-xdebug php-apc php5-gd php5-curl php5-intl
|
||||
|
||||
# launch apache, MySQL and PHPUnit Selenium installers
|
||||
- ./tests/travis/apache_setup.sh
|
||||
- ./tests/travis/mysql_setup.sh
|
||||
- mysql -u root -e "USE social_test; SHOW TABLES;"
|
||||
- cp ./tests/travis/configs/config.test.php.dist config/config.test.php
|
||||
- cp ./tests/travis/configs/config.test.php.dist config/config.local.php
|
||||
- sudo sed -i s/sql-mode/#sql-mode/ /etc/mysql/my.cnf
|
||||
- sudo /etc/init.d/mysql restart
|
||||
- sleep 5
|
||||
|
||||
# get HTML of main page (for debug)
|
||||
- firefox --version
|
||||
- wget -O /tmp/livestreet.test http://livestreet.test
|
||||
- cat /tmp/livestreet.test
|
||||
|
||||
# start virtual display
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- sleep 5
|
||||
|
||||
# download and launch Selenium
|
||||
- wget -O /tmp/selenium-server-standalone.jar http://selenium.googlecode.com/files/selenium-server-standalone-2.25.0.jar
|
||||
- java -jar /tmp/selenium-server-standalone.jar > /dev/null &
|
||||
- sleep 5
|
||||
|
||||
# goto test's folder
|
||||
- cd tests/behat/
|
||||
|
||||
script: HTTP_APP_ENV=test php behat.phar
|
7
tests/travis/apache_setup.sh
Executable file
7
tests/travis/apache_setup.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo apt-get install apache2 libapache2-mod-php5 curl
|
||||
sudo a2enmod rewrite
|
||||
echo "$(curl -fsSL https://raw.github.com/stfalcon-studio/livestreet/master/tests/travis/configs/apache_vhost)" | sed -e "s,PATH,`pwd`,g" | sudo tee -a /etc/apache2/sites-available/default > /dev/null
|
||||
echo "$(curl -fsSL https://raw.github.com/stfalcon-studio/livestreet/master/tests/travis/configs/hosts)" | sudo tee -a /etc/hosts > /dev/null
|
||||
sudo service apache2 restart
|
29
tests/travis/configs/apache_vhost
Normal file
29
tests/travis/configs/apache_vhost
Normal file
|
@ -0,0 +1,29 @@
|
|||
<VirtualHost *:80>
|
||||
ServerAdmin webmaster@localhost
|
||||
|
||||
DocumentRoot PATH
|
||||
ServerName livestreet.test
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/livestreet.log
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit,
|
||||
# alert, emerg.
|
||||
LogLevel warn
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/livestreet.log combined
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerAdmin webmaster@localhost
|
||||
|
||||
DocumentRoot PATH
|
||||
ServerName livestreet.test
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/livestreet.log
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit,
|
||||
# alert, emerg.
|
||||
LogLevel warn
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/livestreet.log combined
|
||||
</VirtualHost>
|
43
tests/travis/configs/config.test.php.dist
Normal file
43
tests/travis/configs/config.test.php.dist
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/*-------------------------------------------------------
|
||||
*
|
||||
* LiveStreet Engine Social Networking
|
||||
* Copyright © 2008 Mzhelskiy Maxim
|
||||
*
|
||||
*--------------------------------------------------------
|
||||
*
|
||||
* Official site: www.livestreet.ru
|
||||
* Contact e-mail: rus.engine@gmail.com
|
||||
*
|
||||
* GNU General Public License, version 2:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
---------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* Настройки для тестового сервера.
|
||||
* Для использования - переименовать файл в config.test.php
|
||||
* Более детальная информация о запуске тестов в tests/README.RU.md
|
||||
*/
|
||||
|
||||
/**
|
||||
* Настройка базы данных
|
||||
*/
|
||||
$config['db']['params']['host'] = 'localhost';
|
||||
$config['db']['params']['port'] = '3306';
|
||||
$config['db']['params']['user'] = 'root';
|
||||
$config['db']['params']['pass'] = '';
|
||||
$config['db']['params']['type'] = 'mysql';
|
||||
$config['db']['params']['dbname'] = 'social_test';
|
||||
$config['db']['table']['prefix'] = 'prefix_';
|
||||
|
||||
$config['sys']['cache']['use'] = false; // использовать кеширование или нет
|
||||
$config['sys']['cache']['solid'] = false;
|
||||
|
||||
$config['module']['user']['captcha_use_registration'] = false; // проверять поле капчи при регистрации пользователя
|
||||
|
||||
$config['lang']['current'] = 'english';
|
||||
$config['lang']['default'] = 'english';
|
||||
|
||||
return $config;
|
||||
?>
|
1
tests/travis/configs/hosts
Normal file
1
tests/travis/configs/hosts
Normal file
|
@ -0,0 +1 @@
|
|||
127.0.0.1 livestreet.test
|
6
tests/travis/mysql_setup.sh
Executable file
6
tests/travis/mysql_setup.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo apt-get install mysql-server mysql-client
|
||||
mysql -u root -e 'CREATE DATABASE social_test;'
|
||||
mysql -u root -B social_test < ./tests/fixtures/sql/install_base.sql
|
||||
mysql -u root -B social_test < ./tests/fixtures/sql/geo_base.sql
|
Loading…
Reference in a new issue