machine:
  environment:
    PATH: $PATH:~/bin
    DISABLE_NOTIFIER: true
    PAGES_BRANCH: pages-test
    GULP_DESTINATION: $CIRCLE_ARTIFACTS
  post:
    - mkdir -p ~/bin
  node:
    version: 0.12
  ruby:
    version: "ruby-2.2.5"

dependencies:
  override:
    - bash ./ci-install-hugo.sh
    - npm install -g gulp
    - npm install
    - gem install bundler
    - cd api && bundle install
    - git config user.name "barricade-machine"
    - git config user.email "engineering+$CIRCLE_USERNAME@barricade.io"
  cache_directories:
    - ~/bin

test:
  override:
    - hugo -v
    - hugo -t barricade -d $CIRCLE_ARTIFACTS
    - cd api && bundle exec middleman build --clean --build_dir $CIRCLE_ARTIFACTS/api
    - gulp
    - cp CNAME $CIRCLE_ARTIFACTS/

deployment:
  master:
    branch: master
    commands:
      - git checkout $PAGES_BRANCH
      - git rm -rf .
      - cp -r $CIRCLE_ARTIFACTS/* .
      - git add -A
      - git commit -am "Build $CIRCLE_BUILD_NUM for $CIRCLE_SHA1"
      - git push -f origin $PAGES_BRANCH

machine:
  environment:
    PATH: $PATH:~/bin
    DISABLE_NOTIFIER: true
    PAGES_BRANCH: pages-test
    GULP_DESTINATION: $CIRCLE_ARTIFACTS
  post:
    - mkdir -p ~/bin
  node:
    version: "v6.1.0"
  ruby:
    version: "ruby-2.2.5"

dependencies:
  override:
    - bash ./ci-install-hugo.sh
    - npm install -g gulp
    - npm install
    - gem install bundler
    - cd api && bundle install
    - git config user.name "barricade-machine"
    - git config user.email "engineering+$CIRCLE_USERNAME@barricade.io"
  cache_directories:
    - ~/bin

test:
  override:
    - hugo -v
    - hugo -t barricade -d $CIRCLE_ARTIFACTS
    - cd api && bundle exec middleman build --clean --build_dir $CIRCLE_ARTIFACTS/api
    - gulp
    - cp CNAME $CIRCLE_ARTIFACTS/

deployment:
  master:
    branch: master
    commands:
      - git checkout $PAGES_BRANCH
      - git rm -rf .
      - cp -r $CIRCLE_ARTIFACTS/* .
      - git add -A
      - git commit -am "Build $CIRCLE_BUILD_NUM for $CIRCLE_SHA1"
      - git push -f origin $PAGES_BRANCH

Use more recent Node.js version
Use more recent Node.js version
