<commit_before>version: 2
jobs:
  build:
    docker:
      - image: cimg/ruby:2.6.6-node
        environment:
          RAILS_ENV: test
          AWS_DEFAULT_REGION: us-west-2
          EB_APP_NAME: ingest
      - image: mdillon/postgis:11
        environment:
          POSTGRES_USER: safecast
          POSTGRES_DB: safecast
          POSTGRES_PASSWORD: ""
      - image: docker.elastic.co/elasticsearch/elasticsearch:6.5.1
    steps:
      - checkout
      - run:
          name: Install build tools
          command: |
            sudo apt-get update
            sudo apt-get install -y postgresql-client python3-pip
            sudo pip3 install wheel
            sudo pip3 install awsebcli awscli
      - restore_cache:
          keys:
            - ingest-{{ checksum "Gemfile.lock" }}
            - ingest-
      - run:
          name: Bundle Install
          command: bundle install --path vendor/bundle
      - save_cache:
          key: ingest-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - run:
          name: Wait for postgres
          command: dockerize -wait tcp://localhost:5432 -timeout 1m
      - run:
          name: Wait for elasticsearch
          command: dockerize -wait tcp://localhost:9200 -timeout 1m
      - run:
          name: Configure database
          command: cp config/database.yml.ci config/database.yml
      - run:
          name: Load schema
          command: |
            psql -h localhost -p 5432 -U safecast safecast -c 'DROP EXTENSION postgis CASCADE'
            bundle exec rake db:structure:load --trace<commit_msg>Explicitly installing bundler.<commit_after>version: 2
jobs:
  build:
    docker:
      - image: cimg/ruby:2.6.6-node
        environment:
          RAILS_ENV: test
          AWS_DEFAULT_REGION: us-west-2
          EB_APP_NAME: ingest
      - image: mdillon/postgis:11
        environment:
          POSTGRES_USER: safecast
          POSTGRES_DB: safecast
          POSTGRES_PASSWORD: ""
      - image: docker.elastic.co/elasticsearch/elasticsearch:6.5.1
    steps:
      - checkout
      - run:
          name: Install build tools
          command: |
            sudo apt-get update
            sudo apt-get install -y postgresql-client python3-pip
            pip3 install wheel
            pip3 install awsebcli awscli
            gem install bundler:1.17.3
      - restore_cache:
          keys:
            - ingest-{{ checksum "Gemfile.lock" }}
            - ingest-
      - run:
          name: Bundle Install
          command: bundle install --path vendor/bundle
      - save_cache:
          key: ingest-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - run:
          name: Wait for postgres
          command: dockerize -wait tcp://localhost:5432 -timeout 1m
      - run:
          name: Wait for elasticsearch
          command: dockerize -wait tcp://localhost:9200 -timeout 1m
      - run:
          name: Configure database
          command: cp config/database.yml.ci config/database.yml
      - run:
          name: Load schema
          command: |
            psql -h localhost -p 5432 -U safecast safecast -c 'DROP EXTENSION postgis CASCADE'
            bundle exec rake db:structure:load --trace
{'fraction_non_alphanumeric': 0.08118081180811808, 'fraction_numerical': 0.01783517835178352, 'mean_word_length': 1.5796986518636003, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '876966', 'n_tokens_mistral': 1000, 'n_tokens_neox': 933, 'n_words': 252}