Skip to content

Instantly share code, notes, and snippets.

@rebelweb
Created August 2, 2017 17:36
Show Gist options
  • Save rebelweb/fbbbf6d8fbd7df17dbd080d9b78e8dd3 to your computer and use it in GitHub Desktop.
Save rebelweb/fbbbf6d8fbd7df17dbd080d9b78e8dd3 to your computer and use it in GitHub Desktop.
Gitlab Ci for Rails with Docker
stages:
- test
- build
variables:
DB_HOST: postgres
DB_PASS: postgres
DB_USER: postgres
brakeman:
stage: test
image: ruby:2.4.1
before_script:
- bundle install
script:
- bundle exec brakeman
rubocop:
stage: test
image: ruby:2.4.1
before_script:
- bundle install
script:
- bundle exec rubocop
rspec:
stage: test
image: ruby:2.4.1
services:
- postgres:latest
before_script:
- bundle install
- rake db:create RAILS_ENV=test
- rake db:schema:load RAILS_ENV=test
script:
- bundle exec rspec
build:
stage: build
only:
- master
image: docker:latest
services:
- docker:dind
script:
- docker build .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment