forked from pixelgrade/gridable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
80 lines (58 loc) · 2.68 KB
/
circle.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
machine:
timezone:
Europe/Copenhagen
node:
version: 6.5.0
php:
version: 5.3.3
# This will be added to the `/etc/hosts` file
hosts:
gridable.dev: 127.0.0.1
general:
branches:
only:
- master
dependencies:
# we automatically cache and restore many dependencies between
# builds. If you need to, you can add custom paths to cache:
cache_directories:
- "~/gridable/node_modules" # relative to the user's home directory
- "~/gridable/wordpress/wp-content/plugins/gridable/node_modules" # relative to the user's home directory
pre:
- npm install gulp -g
# No password is required for the MySQL user `ubuntu`
- mysql -u ubuntu -e "create database wordpress"
# Use cURL to fetch WP-CLI
- curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
# Make sure WP-CLI is executable
- chmod +x wp-cli.phar
# Download WordPress into `wordpress` directory
- ./wp-cli.phar core download --allow-root --path=wordpress
# Generate `wp-config.php` file
- ./wp-cli.phar core config --allow-root --dbname=wordpress --dbuser=ubuntu --dbhost=localhost --path=wordpress
# Install WordPress
- ./wp-cli.phar core install --allow-root --admin_name=admin --admin_password=admin [email protected] --url=http://gridable.dev:8080 --title=WordPress --path=wordpress
- ./wp-cli.phar plugin install jetpack --activate --path=wordpress
- ./wp-cli.phar plugin install customify --activate --path=wordpress
# Clonse WP Pusher plugin from GitHub
#- git clone [email protected]:pixelgrade/gridable.git wordpress/wp-content/plugins/gridable -b 39-phpunit
# or better ...move this build inside the wordpress plugins folder
- cd ../; rsync -av --exclude='gridable/wordpress' gridable gridable/wordpress/wp-content/plugins
- cd wordpress/wp-content/plugins/gridable; npm install; gulp server
# And use WP-CLI to activate it
#- ./wp-cli.phar theme activate gridable --path=wordpress
- tests/install-wp-tests.sh wordpress_test ubuntu '' localhost latest
post:
# Copy Apache conf into `site-available`
- cp ~/gridable/tests/apache-ci.conf /etc/apache2/sites-available
# Use `a2ensite` to create a symlink for the config
- a2ensite apache-ci.conf
# Restart the Apache server
- sudo service apache2 restart
test:
override:
- mkdir -p $CIRCLE_TEST_REPORTS/phpunit
# This is just for us to see that the WP Pusher plugin was actually installed and is active
- ./wp-cli.phar plugin list --path=wordpress
# Finally, run our Behat features
- cd wordpress/wp-content/plugins/gridable/tests; phpunit --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml