Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

version: 2
jobs:
build:
machine:
docker:
- image: alpine:3.4
environment:
DATABASE_URL: postgres://127.0.0.1:5432
RAILS_ENV: test
- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_USER: root
POSTGRES_DB: circle-test_test
- image: redis
steps:
- checkout
- run: mkdir -p /tmp/artifacts
- run:
name: build_image
command: make build
- run:
name: run specs
command: |
make specs
- run:
name: rubocop
command: |
make rubocop
- run:
name: brakeman
command: |
make brakeman
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ruby:3.0.0

WORKDIR /var/gem

COPY . .

RUN gem install bundler:2.3.14

RUN bundle check > /dev/null 2>&1 || bundle install -j4
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
build:
docker-compose build

start:
docker-compose up

specs:
docker-compose run --entrypoint ./scripts/specs web

bash:
docker-compose exec web bash

console:
docker-compose exec web bundle exec rails c

brakeman:
docker-compose run --entrypoint ./scripts/brakeman web

rubocop:
docker-compose run --entrypoint rubocop web
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '2'

services:
web:
build:
context: .
volumes:
- .:/var/gem
depends_on:
- db
db:
image: postgres:9.6.2-alpine
ports:
- '5432'
volumes:
- postgres96:/var/lib/postgresql/data
volumes:
postgres96:
5 changes: 5 additions & 0 deletions scripts/brakeman
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

brakeman --no-exit-on-warn --no-exit-on-error --no-pager --path components/api
brakeman --no-exit-on-warn --no-exit-on-error --no-pager --path components/chat
brakeman --no-exit-on-warn --no-exit-on-error --no-pager --path components/authentication
5 changes: 5 additions & 0 deletions scripts/specs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

bundle install
bundle exec rake db:create db:migrate RAILS_ENV=test
bundle exec rspec .