Skip to content

Commit

Permalink
Merge pull request #77 from palantirnet/circle-ubuntu-14.04
Browse files Browse the repository at this point in the history
Update for use with Circle's Ubuntu 14.04 image
  • Loading branch information
becw authored Jun 8, 2017
2 parents 0e4a915 + 533eace commit 8924165
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
25 changes: 17 additions & 8 deletions circle.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ machine:
hosts:
@[email protected]: 127.0.0.1
php:
version: 5.6.14
version: 5.6.22
node:
version: 0.12.0
environment:
Expand All @@ -16,14 +16,22 @@ general:

dependencies:
pre:
- cp $HOME/$CIRCLE_PROJECT_REPONAME/conf/apache.circle.conf /etc/apache2/sites-available/default
- sed -e "s?%PROJECT_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
# Workaround for broken symlink at /usr/lib/apache2/modules/libphp5.so
- sudo unlink /usr/lib/apache2/modules/libphp5.so
- sudo ln -s /opt/circleci/php/5.6.22/usr/lib/apache2/modules/libphp5.so /usr/lib/apache2/modules/libphp5.so
# Disable XDebug
- rm "/opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini"
# Enable the Apache rewrite module
- sudo a2enmod rewrite
- echo "sendmail_path=/bin/true" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "memory_limit=256M" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memory.ini
# Set up the project webroot
- sudo cp $HOME/$CIRCLE_PROJECT_REPONAME/conf/apache.circle.conf /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%PROJECT_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
# Configure PHP
- echo "sendmail_path=/bin/true" >> "/opt/circleci/php/$(phpenv version-name)/etc/php.ini"
- echo "date.timezone=America/Chicago" >> "/opt/circleci/php/$(phpenv version-name)/etc/php.ini"
- echo "memory_limit=256M" > "/opt/circleci/php/$(phpenv version-name)/etc/conf.d/memory.ini"
# Finally, restart Apache
- sudo service apache2 restart
# Generate a GitHub token per project and add it to the CircleCI environment variables using the web UI.
- composer config --global github-oauth.github.com $GITHUB_TOKEN

override:
- composer install --no-interaction
Expand All @@ -43,4 +51,5 @@ test:
- vendor/bin/phing build install migrate

override:
- vendor/bin/phing code-review test
- vendor/bin/phing code-review
- vendor/bin/phing test
22 changes: 22 additions & 0 deletions conf/apache.circle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<VirtualHost *:80>
UseCanonicalName Off
DocumentRoot %PROJECT_DIR%/web

<Directory %PROJECT_DIR%/web>
Options FollowSymLinks
AllowOverride All
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule %PROJECT_DIR%/(.*)$ index.php/?q=$1 [L,QSA]
Require all granted
</Directory>

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

SetEnv CIRCLECI true
</VirtualHost>

0 comments on commit 8924165

Please sign in to comment.