machine:
  services:
    - docker
  ruby:
    version: 2.3.1

database:
  override:
    - echo "We don't need this"

dependencies:
  override:
    - docker build --rm=false -t codegram/decidim .:
        parallel: false
  post:
    - case $CIRCLE_NODE_INDEX in 0) cd decidim-core && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 ;; 1) cd decidim-admin && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 ;; 2) cd decidim-system && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 ;; 3) echo "OK" ;; esac:
        parallel: true
  cache_directories:
    - "vendor/bundle"

test:
  pre:
    - |
      echo '--format RspecJunitFormatter
      --out $CIRCLE_TEST_REPORTS/rspec/junit.xml
      ' > ~/.rspec
  override:
    - case $CIRCLE_NODE_INDEX in 0) cd decidim-core && bundle exec rake ;; 1) cd decidim-admin && bundle exec rake ;; 2) cd decidim-system && bundle exec rake ;; 3) bundle exec rspec ;; esac:
        parallel: true

machine:
  services:
    - docker
  ruby:
    version: 2.3.1

database:
  override:
    - echo "We don't need this"

dependencies:
  post:
    - case $CIRCLE_NODE_INDEX in 0) cd decidim-core && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 ;; 1) cd decidim-admin && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 ;; 2) cd decidim-system && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 ;; 3) echo "OK" ;; esac:
        parallel: true
  cache_directories:
    - "vendor/bundle"

test:
  pre:
    - |
      echo '--format RspecJunitFormatter
      --out $CIRCLE_TEST_REPORTS/rspec/junit.xml
      ' > ~/.rspec
  override:
    - case $CIRCLE_NODE_INDEX in 0) docker build --rm=false -t codegram/decidim . ;; *) echo "OK" ;; esac:
        parallel: true
    - case $CIRCLE_NODE_INDEX in 0) cd decidim-core && bundle exec rake ;; 1) cd decidim-admin && bundle exec rake ;; 2) cd decidim-system && bundle exec rake ;; 3) bundle exec rspec ;; esac:
        parallel: true

Build docker image in the first node
Build docker image in the first node
