Created
August 2, 2017 17:36
-
-
Save rebelweb/fbbbf6d8fbd7df17dbd080d9b78e8dd3 to your computer and use it in GitHub Desktop.
Gitlab Ci for Rails with Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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