Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# drupal-circleci
# Drupal for CircleCI
An example how to run Behat tests in a Drupal 7 project with CircleCI.

## Usage
1. Fork repo
1. Install CircleCI from marketpalce https://github.com/marketplace/circleci
1. From CircleCi add forked project https://circleci.com/add-projects/gh/[YOUR-USER-NAME]
1. Clone your forked repo & cd to it
1. Change something in READme.txt & commit & push it
1. Watch progresss on https://circleci.com/gh/[YOUR-USER-NAME]
27 changes: 19 additions & 8 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
machine:
php:
version: 5.5.21
version: 5.6.22

dependencies:
pre:
# Set up a virtual host for the site.
- echo "sendmail_path=/bin/true" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "memory_limit=256M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo cp circle/circle.conf /etc/apache2/sites-available/default
- sudo sed -e "s?%PROJECT_DIR%?$(pwd)/www?g" --in-place /etc/apache2/sites-available/default
- echo "alias ls='ls --color'" >> ~/.bashrc
- echo "alias ll='ls -l'" >> ~/.bashrc

# Set php.ini parameters
- echo "sendmail_path=/bin/true" >> /opt/circleci/php/$(phpenv version-name)/etc/php.ini
- echo "memory_limit=256M" >> /opt/circleci/php/$(phpenv version-name)/etc/php.ini

# Fixing faild build from https://discuss.circleci.com/t/apache2-and-php-missing-libphp5-so/3300/6
- sudo unlink /usr/lib/apache2/modules/libphp5.so
- sudo ln -s $PHPENV_ROOT/versions/$(phpenv global)/usr/lib/apache2/modules/libphp5.so /usr/lib/apache2/modules/libphp5.so

- sudo cp circle/circle.conf /etc/apache2/sites-available/default.conf
- sudo sed -e "s?%PROJECT_DIR%?$(pwd)/www?g" --in-place /etc/apache2/sites-available/default.conf
- sudo a2dissite 000-default.conf
- sudo a2ensite default.conf
- sudo a2enmod rewrite
- sudo service apache2 restart
override:
Expand All @@ -25,10 +36,10 @@ dependencies:
- chmod -R +rw www/sites/default/files
- cp circle/settings.php www/sites/default/settings.php
- sudo chown -R $(whoami):www-data www
- bin/drush -y -r www si standard --site-name=sandbox7 --account-name=admin --account-pass=admin
- bin/drush --yes --root=www site-install standard --site-name=sandbox7 --account-name=admin --account-pass=admin
# Set tmp and private file system paths.
- bin/drush -r www vset --exact file_temporary_path "/tmp/sandbox7"
- bin/drush -r www vset --exact file_private_path "/tmp/sandbox7-private"
- bin/drush --yes --root=www vset --exact file_temporary_path "/tmp/sandbox7"
- bin/drush --yes --root=www vset --exact file_private_path "/tmp/sandbox7-private"
cache_directories:
- vendor
- bin
Expand Down
3 changes: 1 addition & 2 deletions circle/circle.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule %PROJECT_DIR%/(.*)$ index.php/?q=$1 [L,QSA]
Order allow,deny
Allow from all
Require all granted
</Directory>

<Directory />
Expand Down