diff options
| -rw-r--r-- | Gemfile | 4 | ||||
| -rw-r--r-- | Gemfile.lock | 7 | ||||
| -rw-r--r-- | config/deploy.rb | 6 | ||||
| -rw-r--r-- | config/recipes/rbenv.rb | 40 | ||||
| -rw-r--r-- | config/recipes/rvm.rb | 1 |
5 files changed, 55 insertions, 3 deletions
@@ -65,3 +65,7 @@ group :production, :staging do gem 'newrelic_rpm' gem 'dalli' end + +group :staging do + gem 'unicorn' +end diff --git a/Gemfile.lock b/Gemfile.lock index 27b1c656..ac722820 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,6 +145,7 @@ GEM kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) + kgio (2.8.0) lol_dba (1.5.0) actionpack (>= 3.0) activerecord (>= 3.0) @@ -193,6 +194,7 @@ GEM activesupport (= 4.0.0) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) + raindrops (0.11.0) rake (10.1.0) rdoc (3.12.2) json (~> 1.4) @@ -260,6 +262,10 @@ GEM uglifier (2.1.2) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) + unicorn (4.6.3) + kgio (~> 2.6) + rack + raindrops (~> 0.7) uniform_notifier (1.2.0) warden (1.2.3) rack (>= 1.0) @@ -317,3 +323,4 @@ DEPENDENCIES teaspoon turbolinks uglifier (>= 1.3.0) + unicorn diff --git a/config/deploy.rb b/config/deploy.rb index 8599701d..e0510abd 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,6 +1,9 @@ -load "config/recipes/rvm" +require 'bundler/capistrano' + load "config/recipes/environments" load "config/recipes/base" +#load "config/recipes/rvm" +load "config/recipes/rbenv" load "config/recipes/nginx" load "config/recipes/unicorn" load "config/recipes/postgresql" @@ -9,7 +12,6 @@ load "config/recipes/monit" set :application, "cakeside" set :user, "deployer" -#set :group, "rvm" set :use_sudo, false default_run_options[:pty] = true # password prompt diff --git a/config/recipes/rbenv.rb b/config/recipes/rbenv.rb new file mode 100644 index 00000000..3f1fd1dd --- /dev/null +++ b/config/recipes/rbenv.rb @@ -0,0 +1,40 @@ +set_default :ruby_version, "2.0.0-p247" + +namespace :rbenv do + desc "install rbenv" + task :install, roles: :app do + # Install development tools: + run "#{sudo} apt-get -y install build-essential" + # Packages required for compilation of some stdlib modules + run "#{sudo} apt-get -y install tklib" + # Extras for RubyGems and Rails: + run "#{sudo} apt-get -y install zlib1g-dev libssl-dev" + # Readline Dev on Ubuntu 12.04 LTS: + run "#{sudo} apt-get -y install libreadline-gplv2-dev" + # Install some nokogiri dependencies: + run "#{sudo} apt-get -y install libxml2 libxml2-dev libxslt1-dev" + + run "curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash" + bashrc = <<-BASHRC +if [ -d $HOME/.rbenv ]; then + export PATH="$HOME/.rbenv/bin:$PATH" + eval "$(rbenv init -)" +fi +BASHRC + put bashrc, "/tmp/rbenvrc" + run "cat /tmp/rbenvrc ~/.bashrc > ~/.bashrc.tmp" + run "mv ~/.bashrc.tmp ~/.bashrc" + run %q{export PATH="$HOME/.rbenv/bin:$PATH"} + run %q{eval "$(rbenv init -)"} + end + after "deploy:install", "rbenv:install" + + desc "setup rbenv with ruby and bundler" + task :setup, roles: :web do + run "rbenv install #{ruby_version}" + run "rbenv global #{ruby_version}" + run "gem install bundler --no-ri --no-rdoc" + run "rbenv rehash" + end + after "deploy:setup", "rbenv:setup" +end diff --git a/config/recipes/rvm.rb b/config/recipes/rvm.rb index b4ecf772..c1817baa 100644 --- a/config/recipes/rvm.rb +++ b/config/recipes/rvm.rb @@ -1,5 +1,4 @@ require "rvm/capistrano" -require 'bundler/capistrano' set :rvm_ruby_string, :local set :rvm_autolibs_flag, :enable set :rvm_type, :user |
