Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Make circle.yml configurable via config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dkinzer committed Jan 13, 2017
1 parent 00ccb17 commit 032cf37
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 220 deletions.
5 changes: 2 additions & 3 deletions .ahoy/site/build.ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,8 @@ commands:
usage: ahoy build config - Applies site specific changes stored in config.yml
cmd: |
# render custom .htaccess
tempdir=$(mktemp -d "/tmp/$0.XXXXXXXX")
ahoy cmd-proxy ruby .ahoy/site/.scripts/htaccess.rb > $tempdir/.htaccess
cp $tempdir/.htaccess config/.htaccess
ahoy cmd-proxy ruby .ahoy/site/.scripts/htaccess.rb > config/.htaccess
ahoy cmd-proxy ruby .ahoy/site/.scripts/circle.rb > circle.yml
# Transpose config.yml to php
cd .ahoy/site
Expand Down
58 changes: 58 additions & 0 deletions assets/templates/circle.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Customize the test machine
machine:
php:
version: '5.6.22'

# Add some environment variables
environment:
PATH: $PATH:$HOME/.config/composer/vendor/bin
DATABASE_URL: mysql://ubuntu:@127.0.0.1:3306/circle_test
# Timeouts issues happen when selenium tries to spawn a new chrome
# instance. I've nail that down to this selenium issue
# https://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null
## Customize checkout
## Note: Only post is supported.
checkout:
post:
# Remove the extra composer stuff that circleci loads and that is causing conflicts with drush.
- rm -rf ~/.composer

## Customize dependencies
dependencies:
cache_directories:
- "~/.drush"
pre:
- rm /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
- echo "memory_limit = <%= @memory_limit %>" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/memory.ini
- echo "always_populate_raw_post_data = -1" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/deprecated.ini
- sudo apt-get update -y && sudo apt-get install -y x11vnc clamav clamav-freshclam
- yes | sudo perl -MCPAN -e "install Digest::HMAC_SHA1;"

override:
- printenv
- mkdir $CIRCLE_ARTIFACTS/junit
- cd tests; composer install; cd ..
- bash dkan/dkan-init.sh dkan --deps-only
- ahoy site up --db-user=ubuntu --db-pass='' --db-host=127.0.0.1 --db-port=3306 --db-name=circle_test
- ahoy utils fail-when-bad-disable
# Run a webserver using drush.
- 'ahoy drush --yes runserver :8888':
background: true

- wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
- java -jar selenium-server-standalone-2.53.1.jar -p 4444 :
background: true
post:
- x11vnc -forever -nopw:
background: true

## Customize test commands
test:
override:
- BEHAT_FOLDER=$HOME/$CIRCLE_PROJECT_REPONAME/tests ruby dkan/.ahoy/.scripts/circle-behat.rb <%= @test_dirs.join(" ") %> --tags='~@customizable&&~@fixme&&~@testBug':
timeout: 1200
parallel: true
post:
- echo $CIRCLE_ARTIFACTS; cp -av tests/assets $CIRCLE_ARTIFACTS:
parallel: true
116 changes: 58 additions & 58 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
## Customize the test machine
machine:
php:
version: '5.6.22'

# Add some environment variables
environment:
PATH: $PATH:$HOME/.config/composer/vendor/bin
DATABASE_URL: mysql://ubuntu:@127.0.0.1:3306/circle_test
# Timeouts issues happen when selenium tries to spawn a new chrome
# instance. I've nail that down to this selenium issue
# https://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null
## Customize checkout
## Note: Only post is supported.
checkout:
post:
# Remove the extra composer stuff that circleci loads and that is causing conflicts with drush.
- rm -rf ~/.composer

## Customize dependencies
dependencies:
cache_directories:
- "~/.drush"
pre:
- rm /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
- echo "memory_limit = 256M" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/memory.ini
- echo "always_populate_raw_post_data = -1" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/deprecated.ini
- sudo apt-get update -y && sudo apt-get install -y x11vnc clamav clamav-freshclam
- yes | sudo perl -MCPAN -e "install Digest::HMAC_SHA1;"

override:
- printenv
- mkdir $CIRCLE_ARTIFACTS/junit
- cd tests; composer install; cd ..
- bash dkan/dkan-init.sh dkan --deps-only
- ahoy site up --db-user=ubuntu --db-pass='' --db-host=127.0.0.1 --db-port=3306 --db-name=circle_test
- ahoy utils fail-when-bad-disable
# Run a webserver using drush.
- 'ahoy drush --yes runserver :8888':
background: true

- wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
- java -jar selenium-server-standalone-2.53.1.jar -p 4444 :
background: true
post:
- x11vnc -forever -nopw:
background: true

## Customize test commands
test:
override:
- BEHAT_FOLDER=$HOME/$CIRCLE_PROJECT_REPONAME/tests ruby dkan/.ahoy/.scripts/circle-behat.rb tests/features dkan/test/features config/tests/features --tags='~@customizable&&~@fixme&&~@testBug':
timeout: 1200
parallel: true
post:
- echo $CIRCLE_ARTIFACTS; cp -av tests/assets $CIRCLE_ARTIFACTS:
parallel: true
## Customize the test machine
machine:
php:
version: '5.6.22'

# Add some environment variables
environment:
PATH: $PATH:$HOME/.config/composer/vendor/bin
DATABASE_URL: mysql://ubuntu:@127.0.0.1:3306/circle_test
# Timeouts issues happen when selenium tries to spawn a new chrome
# instance. I've nail that down to this selenium issue
# https://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null
## Customize checkout
## Note: Only post is supported.
checkout:
post:
# Remove the extra composer stuff that circleci loads and that is causing conflicts with drush.
- rm -rf ~/.composer

## Customize dependencies
dependencies:
cache_directories:
- "~/.drush"
pre:
- rm /opt/circleci/php/$(phpenv global)/etc/conf.d/xdebug.ini
- echo "memory_limit = 256M" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/memory.ini
- echo "always_populate_raw_post_data = -1" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/deprecated.ini
- sudo apt-get update -y && sudo apt-get install -y x11vnc clamav clamav-freshclam
- yes | sudo perl -MCPAN -e "install Digest::HMAC_SHA1;"

override:
- printenv
- mkdir $CIRCLE_ARTIFACTS/junit
- cd tests; composer install; cd ..
- bash dkan/dkan-init.sh dkan --deps-only
- ahoy site up --db-user=ubuntu --db-pass='' --db-host=127.0.0.1 --db-port=3306 --db-name=circle_test
- ahoy utils fail-when-bad-disable
# Run a webserver using drush.
- 'ahoy drush --yes runserver :8888':
background: true

- wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
- java -jar selenium-server-standalone-2.53.1.jar -p 4444 :
background: true
post:
- x11vnc -forever -nopw:
background: true

## Customize test commands
test:
override:
- BEHAT_FOLDER=$HOME/$CIRCLE_PROJECT_REPONAME/tests ruby dkan/.ahoy/.scripts/circle-behat.rb tests/features dkan/test/features config/test/features --tags='~@customizable&&~@fixme&&~@testBug':
timeout: 1200
parallel: true
post:
- echo $CIRCLE_ARTIFACTS; cp -av tests/assets $CIRCLE_ARTIFACTS:
parallel: true
Loading

0 comments on commit 032cf37

Please sign in to comment.