forked from ding2/ding2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
65 lines (62 loc) · 2.89 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
machine:
php:
# We support PHP 7.0.x so choose the latest version supported by Circle.
version: 7.0.17
node:
# Our frontend asset pipeline requires 6.10.0 or greater.
version: 6.10.0
environment:
# This is where we build our complete Drupal site
DRUPAL_SITE_PATH: $HOME/build
hosts:
ding2.dev: 127.0.0.1
dependencies:
post:
# Increase memory limit to 512M. This is required by ding2.
- echo "memory_limit = 512M" > /opt/circleci/php/$(phpenv global)/etc/conf.d/memory.ini
# Disable mail sending. Sendmail is not working on Circle.
- echo "sendmail_path = /bin/true" > /opt/circleci/php/$(phpenv global)/etc/conf.d/sendmail.ini
# Increase xdebug nesting level (php7cc requires this).
- echo "xdebug.max_nesting_level = 1000" > /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
# Clean up existing global composer installation. It contains dependencies
# which do not match the PHP version we use. This prevents installation of
# other packages.
- rm -rf ~/.composer/vendor
# Install drush globally using composer.
# Use prefer-source to get around GitHub API rate limits.
- composer global require drush/drush:6.* --prefer-source --no-interaction
# Install PHP 7.x Compatibility Checker.
- composer global require sstalle/php7cc
# Install behat and dependencies.
- (cd tests/behat &&
composer install --no-progress --prefer-source)
# Set up Apache to serve our site.
# We use PHP7 - not PHP5 so remove it from our installation. The actual version of PHP is defined in ding2.conf
- sudo a2dismod php5
- sudo cp tests/behat/apache.conf /etc/apache2/sites-available/ding2.conf
- sudo a2ensite ding2.conf
- sudo a2enmod rewrite
- sudo service apache2 restart
# Start selenium.
- wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar && java -jar selenium-server-standalone-2.44.0.jar:
background: true
test:
override:
- make circle-setup
- make circle-run-unit-tests
- make circle-run-behat-tests:
parallel: true
post:
# Clean up after site install.
# sudo is required here. The files are not writeable.
- sudo rm -rf $DRUPAL_SITE_PATH/sites/default/settings.php $DRUPAL_SITE_PATH/sites/default/files
# Remove node_modules folder. This is not needed in the final artifact.
- rm -rf $DRUPAL_SITE_PATH/profiles/ding2/themes/ddbasic/node_modules
# Remove ding_test composer vendor folder.
- rm -rf $DRUPAL_SITE_PATH/profiles/ding2/modules/ding_test/vendor
# Remove behat test composer vendor folder.
- rm -rf $DRUPAL_SITE_PATH/profiles/ding2/tests/behat/vendor
# Remove selenium jar file.
- rm -rf $DRUPAL_SITE_PATH/profiles/ding2/selenium*
# Wrap the site into an archieve and expose it as an artifact.
- tar -zcvf $CIRCLE_ARTIFACTS/ding2-$CIRCLE_SHA1.tar.gz -C $DRUPAL_SITE_PATH .