version: 2

jobs:
  build:
    working_directory: ~/bearden
    docker:
      - image: circleci/ruby:2.5-node
        environment:
          RAILS_ENV: test
      - image: circleci/postgres:10.1-alpine
      - image: circleci/elasticsearch
    steps:
      - run: sudo apt-get install libicu-dev
      - checkout
      - type: cache-restore
        key: bearden-{{ checksum "Gemfile.lock" }}
      - run: bundle install --path vendor/bundle
      - type: cache-save
        key: bearden-{{ checksum "Gemfile.lock" }}
        paths:
          - vendor/bundle

      # Make sure that Elasticsearch is up before running tests:
      - run: sleep 10 && curl --retry 10 --retry-delay 5 -v http://127.0.0.1:9200/

      - run: mv config/database{.circle,}.yml
      - run: bundle exec rake db:create db:migrate
      - run: bundle exec rake

      - run: bash .circleci/heroku_setup
      - add_ssh_keys:
          fingerprints:
            - "85:44:31:07:7a:a0:4e:bb:50:91:f0:d8:23:8f:69:03"
      - deploy:
          name: Deploy
          command: .circleci/heroku_deploy

version: 2

jobs:
  build:
    working_directory: ~/bearden
    docker:
      - image: artsy/ruby:2.5.1-node-chrome
        environment:
          RAILS_ENV: test
      - image: circleci/postgres:10.1-alpine
      - image: circleci/elasticsearch
    steps:
      - run: sudo apt-get install libicu-dev
      - checkout
      - type: cache-restore
        key: bearden-{{ checksum "Gemfile.lock" }}
      - run: bundle install --path vendor/bundle
      - type: cache-save
        key: bearden-{{ checksum "Gemfile.lock" }}
        paths:
          - vendor/bundle

      # Make sure that Elasticsearch is up before running tests:
      - run: sleep 10 && curl --retry 10 --retry-delay 5 -v http://127.0.0.1:9200/

      - run: mv config/database{.circle,}.yml
      - run: bundle exec rake db:create db:migrate
      - run: bundle exec rake

      - run: bash .circleci/heroku_setup
      - add_ssh_keys:
          fingerprints:
            - "85:44:31:07:7a:a0:4e:bb:50:91:f0:d8:23:8f:69:03"
      - deploy:
          name: Deploy
          command: .circleci/heroku_deploy

Switch to Artsy Ruby image
Switch to Artsy Ruby image
