Gem to support Rails Apps Deployment cycle
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
public
.gitignore
Gemfile
LICENSE.txt
README.textile
Rakefile
lebops.gemspec

README.textile

LebOps

Rails gem which normalizes the deployment life-cycle of Rails Web App.

Based on:

  • RVM, Capistrano and Rake tasks.
  • Different environments [development test vagrant staging production]
  • Two different repositories: Development and Client remotes

Installation

Add this line to your application’s Gemfile:

gem 'lebops', github: 'jlebrijo/lebops'

And then execute:

bundle

Or install it yourself as:

$ gem install lebops

Usage

Configure Capistrano Environments

1. Bundle and Capify with: capify .

2. Configure config/deploy.rb:

set :application, "pet-contest"
require 'lebops/deploy' 

3. Create particular config for each environment in deploy/[staging.rb|vagrant.rb|production.rb]. i.e.:

set :thin_servers, 1
set :thin_port, 3500
server "labs.myhome.com", :app, :web, :db, :primary => true
set :repository,  "git@labs.myhome.com:#{application}.git"
set :database_username, 'user'
set :database_password, 'password'

4. Install application:

cap [env] app:setup

Operation tasks

Application operation tasks:

cap app:setup                # Setup or reset: DB and App_server
cap app:update               # Update from last release: DB and App_server

Accessing your environments resources:

cap [env] ops:console              # Open a console for the current stage
cap [env] ops:log                  # Tail the Rails log for the current stage
cap [env] ops:ssh                  # Open a ssh connection for the current stage

DDBB Server:

cap [env] db:config                # Configure database.yml
cap [env] db:migrate               # Only migrates ddbb
cap [env] db:reset                 # Sets up the database: drop if exists, create, migrate and seed

App server:

cap [env] thin:config              # Creates config file
cap [env] thin:restart             # Restart server
cap [env] thin:setup               # Sets up Thin gem
cap [env] thin:start               # Start server
cap [env] thin:stop                # Stop server

Development cycle tasks:

rake db:reset                 # Reset and seed DataBase

Release Cycle tasks

Releasing code:

  • rake version:client_remote[gitbitbucket.org:jlebrijo/pet-contest.git]@ : create remote with client repo in local
  • rake version:release[0.1.3] : For all remotes
    • Merge (Fast Forward) origin:master / client_remote:master
    • Create a tag with version number
  • rake version:remove[0.1.3] : deletes version tag in all remotes

Contributing

  1. Fork it
  2. Create your feature branch (`git checkout -b my-new-feature`)
  3. Commit your changes (`git commit -am ‘Add some feature’`)
  4. Push to the branch (`git push origin my-new-feature`)
  5. Create new Pull Request

License

MIT License. Copyright 2013

You are not granted rights or licenses to the trademarks of the Lebrijo.com, including without limitation the LebOps name or logos.