Coder Social home page Coder Social logo

talhashoaib / drone-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juicymo/drone-ruby

0.0 1.0 0.0 25 KB

Drone 0.7.0 CI image to build Ruby 2.4.2/2.5.1 apps we use at Juicymo

Home Page: https://hub.docker.com/r/juicymo/drone-ruby/

Dockerfile 38.05% Shell 61.95%

drone-ruby's Introduction

Juicymo Drone CI Ruby image

We use this image on a daily basis at Juicymo for Continuous Integration of Ruby on Rails apps we make for our clients.

Installation

Compiled Docker image can be pulled from: Docker Hub.

About

This is a Ruby image for Drone, inspired by 413x/ruby-2.3.3-alpine.

Intent of this image is CI testing of Ruby or Rails projects with Drone.

This image supports Drone 0.7.0 and MRI Ruby 2.5.3:

It has a bundler installed.

If you need more Ruby versions, let us know via GitHub issues or feel free to fork this Docker image or build a new one based on this one.

We use the drillster/drone-volume-cache image to smartly cache the ./bundle and ./node_modules folders to have faster builds which consume less resources because only updated gems and npm packages are reinstalled.

Usage

Just add similar .drone.yml to you project (example is compatible with Drone 0.7.0):

pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - ./bundle
      - ./node_modules
    volumes:
      - /tmp/cache:/cache

  build:
    image: juicymo/drone-ruby:2.5.3
    environment:
      - RAILS_ENV=test
    commands:
      - bundle install --path ./bundle --without production,development

  rebuild-cache:
    image: drillster/drone-volume-cache
    rebuild: true
    mount:
      - ./bundle
      - ./node_modules
    volumes:
    - /tmp/cache:/cache

  test:
    image: juicymo/drone-ruby:2.5.3
    environment:
      - RAILS_ENV=test
      - DB_HOST=database
    commands:
      - bundle install --path ./bundle --without production,development
      - bundle exec rake db:create
      - bundle exec rake db:migrate
      - bundle exec rspec
      - bundle exec rake spinach

  notify:
    image: plugins/slack
    webhook: https://team.slack.com/hooks/XXX...
    channel: dev
    username: drone
    when:
      status: [ success, failure ]

services:
  database:
    image: postgres:10.5
    environment:
      - POSTGRES_USER=...
      - POSTGRES_PASSWORD=...

The example drone.yml file above shows how RSpec and Spinach can be used for BDD Testing in a Ruby on Rails application. This is what we use at Juicymo, but feel free to adjust the test step of a pipeline to suit your needs.

At Juicymo, we use GitLab which is connected to our Drone CI server. With this setup Drone is able to detect all projects from GitLab automatically. After particular Ruby on Rails project is enabled for testing in Drone, all you need to do is to add, commit and push a .drone.yml to the git repository. Drone will automatically load it and start the integration.

See source at GitHub.

drone-ruby's People

Contributors

podruh avatar inza avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.