Giter Club home page Giter Club logo

cap_bootstrap's Introduction

Cap Bootstrap

Capistrano tasks for deploying Rails applications using Ubuntu 10.04, rbenv, nginx, Unicorn and PostgreSQL. Based on the excellent Railscasts by Ryan Bates, with permission of course. If you are new to Capistrano or setting up a VPS, I highly recommend subscribing to his pro screencasts and watching the following:

I am not affiliated with Railscasts, I'm just a fan.

Requirements

  • Capistrano
  • Fresh Ubuntu 10.04 or 11.10 install

Installation

Add these lines to your application's Gemfile:

gem 'capistrano'
gem 'cap_bootstrap'

And then execute:

$ bundle

Usage

Setup a new Ubuntu 10.04 slice. Add a user called deployer with sudo privileges.

In your project, run the following:

capify .

Then run this generator with an optional IP address to copy over a deploy.rb that is more suited to this gem. The application name defaults to the same name as your rails app and the repository is pulled from your .git/config.

rails g cap_bootstrap:install 99.99.99.99

Double check the settings in config/deploy.rb and then run:

cap deploy:install
cap deploy:setup
cap deploy:cold

Advanced Options

Shown below are the default advanced settings, but they can overridden.

Setup

set(:domain) { "#{application}.com" }

PostgreSQL

set :postgresql_host, "localhost"
set(:postgresql_user) { application }
set(:postgresql_database) { "#{application}_production" }

Ruby

set :ruby_version, "1.9.3-p125"
set :rbenv_bootstrap, "bootstrap-ubuntu-10-04" # Or bootstrap-ubuntu-11-10

Unicorn

set(:unicorn_user) { user }
set(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" }
set(:unicorn_config) { "#{shared_path}/config/unicorn.rb" }
set(:unicorn_log) { "#{shared_path}/log/unicorn.log" }
set :unicorn_workers, 2

Future Plans

Version 0.1 uses Ryan's recipes pulled directly from Railscast episode #337 Capistrano Recipes. You will always be able to access this version with tag v0.1.

Future versions will incorporate optional installs such as MySQL, Apache, Phusion Passenger and additional server config such as setting a hostname. Also considering changes to allow deploying multiple apps onto a single server and provisioning Linode slices using their api.

Alternatives

Contributing

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

cap_bootstrap's People

Contributors

cwsaylor avatar

Stargazers

Angus H. avatar

Watchers

Mohammed AlSheikh avatar  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.