-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
54 lines (52 loc) · 2.6 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
machine:
php:
# We support PHP 5.4 so choose the latest version supported by Circle.
version: 5.4.37
node:
# Our frontend asset pipeline requires 0.12.0 or greater.
version: 0.12.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" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memory.ini
# Disable mail sending. Sendmail is not working on Circle.
- echo "sendmail_path = /bin/true" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/sendmail.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
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)
- git diff --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)
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 .