Skip to content

Instantly share code, notes, and snippets.

@almaron
Created June 20, 2017 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almaron/cbb0f987988c082e2f34565f98b01b71 to your computer and use it in GitHub Desktop.
Save almaron/cbb0f987988c082e2f34565f98b01b71 to your computer and use it in GitHub Desktop.
.use-docker: &use-docker
image: docker:latest
variables:
DOCKER_DRIVER: overlay
services:
- docker:dind
before_script:
- docker login -u $CI_BUILD_USER -p $CI_BUILD_TOKEN registry.gitlab.com
- echo $CI_BUILD_REF >> REVISION
run tests:
<<: *use-docker
image: ruby:2.4-alpine
services:
- postgres:9.6-alpine
variables:
RAILS_ENV: test
DB_HOST: postgres
before_script:
- apk add --update git libpq nodejs
- cp config/secrets.example.yml config/secrets.yml
- apk --update add --virtual build_deps build-base ruby-dev postgresql-dev libxml2-dev libxslt-dev
- bundle install --without production development --path /cache/vendor
- bundle exec rake db:create db:test:prepare
- apk del build_deps
stage: test
script:
- bundle exec rubocop -l
- bundle exec rspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment