forked from easySuite/ding2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
65 lines (63 loc) · 3.42 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: /tmp/drupal
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
test:
override:
# Build profile using drush make
- drush make ding2.make --no-core --contrib-destination=. -y
# Install theme dependencies
- (cd themes/ddbasic && npm install)
# Process theme files.
# If there are any changes then fail the build. The result of processing
# should be committed along with the source changes.
- (cd themes/ddbasic && node_modules/.bin/gulp uglify sass)
# Readable changes. Exclude minified CSS files compiled from SCSS. Changes
# in verbose version will probably also apply here.
- git diff --exit-code -- . ':(exclude)themes/ddbasic/css/*.min.css'
# Do a complete diff in short form as well for good measure. This will
# catch changes in excluded files.
- git diff --stat --exit-code
# Built an entire Drupal site with core, contrib and custom code
# First we build Drupal core only. Instead of using the profile specified in
# the make file we use the one we have just build.
# This way we do not have to update drupal.make for each build.
- drush make drupal.make --projects=drupal -y $DRUPAL_SITE_PATH
# Copy the current profile which has just been built into Drupal core
- mkdir $DRUPAL_SITE_PATH/profiles/ding2
- cp -R ./* $DRUPAL_SITE_PATH/profiles/ding2/
# Install the site using the ding2 profile
- (cd $DRUPAL_SITE_PATH && drush site-install ding2 --db-url=mysql://[email protected]/circle_test -y)
# Run PHP7 Compatibility Checker - using tee to get non-rezero exit code (see https://github.com/sstalle/php7cc/issues/102)
- 'php7cc --except=vendor --level=error --extensions=php,inc,module,install $DRUPAL_SITE_PATH | tee /dev/tty | grep -vq ''File: '''
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
# 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 .