Commit d3442ca
Changed files (1)
.gitlab-ci.yml
@@ -0,0 +1,32 @@
+# https://hub.docker.com/r/library/ruby/tags/
+image: "ruby:2.3"
+
+# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service
+services:
+ - redis:latest
+ - postgres:latest
+
+variables:
+ POSTGRES_DB: database_name
+
+cache:
+ paths:
+ - vendor/ruby
+
+before_script:
+ - ruby -v # Print out ruby version for debugging
+ - apt-get update -q && apt-get install nodejs -yqq
+ - gem install bundler --no-ri --no-rdoc # Bundler is not installed with the image
+ - bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
+
+rspec:
+ script:
+ - rspec spec
+
+rails:
+ variables:
+ DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
+ script:
+ - bundle exec rake db:migrate
+ - bundle exec rake db:seed
+ - bundle exec rake test