metaps/genova

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
jobs:
  build:
    docker:
      - image: cimg/ruby:3.2.2
    working_directory: ~/genova
    environment:
      AWS_ACCESS_KEY: ""
      AWS_ACCOUNT_ID: ""
      AWS_REGION: ""
      AWS_SECRET_KEY: ""
      GITHUB_ACCOUNT: metaps
      REDIS_DB: 0
      REDIS_HOST: localhost
      REDIS_PORT: 6379
      RAILS_ENV: test
      MONGO_DB: test_slackbot
      MONGO_DB_TEST: test_slackbot
      MONGO_HOST: localhost
      MONGO_PORT: 27017
      SECRET_KEY_BASE: ""
    steps:
      - checkout
      - run:
          name: initialize
          command: |
            mkdir -p ~/.ssh
            touch ~/.ssh/id_rsa
            sudo apt-get update --allow-releaseinfo-change
            sudo apt-get install nodejs
      - restore_cache:
          key: bundle-{{ checksum "Gemfile.lock" }}
      - run:
          name: bundle install
          command: bundle install --path=vendor/bundle --jobs=4
      - save_cache:
          key: bundle-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - run:
          name: install redis
          command: |
            sudo apt-get install redis-server
            sudo service redis-server start
      - run:
          name: install mongodb
          command: |
            wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
            echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
            wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
            sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
            sudo apt-get update
            sudo apt-get install -y mongodb-org
            sudo chmod 777 /var/lib/mongodb
            sudo chmod 777 /var/log/mongodb
            mongod --dbpath /var/lib/mongodb --fork --logpath=/var/log/mongodb/mongod.log
      - run:
          name: rspec test
          command: |
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter
            ./cc-test-reporter before-build
            bundle exec rspec
            CC_TEST_REPORTER_ID=8bea1dba2c816186dc45b6cca733f7a4d861d6b48bca8f0ee474ab6461261235 ./cc-test-reporter after-build --exit-code $?