forked from anspress/anspress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
46 lines (42 loc) · 1.84 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
image: php:5.6-fpm
services:
- mysql
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: wptest
MYSQL_ROOT_PASSWORD: root
WP_VERSION: latest
WP_MULTISITE: 0
before_script:
- wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
- php --version
- bash bin/docker_install.sh > /dev/null
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- mysql -e 'create database wptestloader;'
# configure apache virtual hosts
- echo "$(curl -fsSL https://gist.github.com/rahularyan/5b179508f63cebbce486/raw/gistfile1.txt)" | sed -e "s,PATH,`pwd`/www,g" | sudo tee /etc/apache2/sites-available/default > /dev/null
- echo "127.0.0.1 wptest.localhost" | sudo tee -a /etc/hosts
- sudo service apache2 restart
- sudo apt-get install git
- wget http://codeception.com/codecept.phar
- sudo curl -LsS http://codeception.com/codecept.phar -o /usr/local/bin/codecept
- sudo chmod a+x /usr/local/bin/codecept
- codecept -V
- composer require lucatume/wp-browser ^1.13
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- java -jar selenium-server-standalone-2.42.2.jar -port 4444 -Djava.security.egd=file:///dev/urandom switch > /dev/null &
- sleep 10
- ./vendor/bin/wpcept build
- bash tests/bin/install.sh wptest root $MYSQL_ROOT_PASSWORD localhost $WP_VERSION
stages:
- test
test:
script:
- ./vendor/bin/wpcept run --steps --debug