Skip to content

Instantly share code, notes, and snippets.

@PelagicDev
Forked from benphelps/.gitlab-ci.yml
Created January 17, 2017 15:21
Show Gist options
  • Save PelagicDev/e0b4dba2cc059a0e952bf72dbbff9332 to your computer and use it in GitHub Desktop.
Save PelagicDev/e0b4dba2cc059a0e952bf72dbbff9332 to your computer and use it in GitHub Desktop.
A test / deploy setup I use
image: benphelps/docker-ruby-phantomjs:latest
Testing:
services:
- postgres:latest
variables:
POSTGRES_DB: test
POSTGRES_HOST: postgres
POSTGRES_USER: testuser
POSTGRES_PASS: testuser
environment: test
script:
- gem install bundler
- touch log/application.log
- touch log/test.log
- bundle install --jobs $(nproc) --path=/cache/bundler
- "RAILS_ENV=test rails db:drop db:create db:schema:load"
- bundle exec rspec
stage: test
tags:
- rails
Deploy to Staging:
only:
- deploy/staging
environment: staging
script: curl -X POST https://hooks.cloud66.com/stacks/redeploy/<key>
stage: deploy
tags:
- rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment