From 8bb48790379265c773c5ca8f3a1888f905b82709 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Fri, 16 Aug 2013 22:35:28 -0300 Subject: [PATCH] New deploy --- Gemfile | 3 +++ Gemfile.lock | 2 ++ config/deploy.rb | 41 +++++++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index 5c8b9d2..f54513e 100644 --- a/Gemfile +++ b/Gemfile @@ -39,6 +39,9 @@ gem 'devise', '~> 3.0.0' # Kalibro integration gem 'kalibro_entities', git: 'https://github.com/mezuro/kalibro_entities.git' #When the first version of KalibroEntities come out, do not keep using the git repository +#PostgreSQL integration +gem "pg", "~> 0.16.0" + group :doc do # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', require: false diff --git a/Gemfile.lock b/Gemfile.lock index fe7521e..c1189f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,6 +120,7 @@ GEM nokogiri (1.5.10) nori (2.3.0) orm_adapter (0.4.0) + pg (0.16.0) polyglot (0.3.3) rack (1.5.2) rack-test (0.6.2) @@ -227,6 +228,7 @@ DEPENDENCIES kalibro_entities! mocha modernizr-rails + pg (~> 0.16.0) rails (= 4.0.0) rspec-rails rvm-capistrano diff --git a/config/deploy.rb b/config/deploy.rb index 54df039..a8da78a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,12 +1,12 @@ require "rvm/capistrano" require 'bundler/capistrano' +set :default_shell, "/bin/bash -l" +set :rails_env, "production" + set :rvm_ruby_string, :local # use the same ruby as used locally for deployment set :rvm_autolibs_flag, "read-only" # more info: rvm help autolibs -set :rvm_type, :system - -#before 'deploy:setup', 'rvm:install_rvm' # install RVM -#before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR: # before 'deploy:setup', 'rvm:create_gemset' # only create gemset +#set :rvm_type, :system set :application, "mezuro" set :deploy_to, "/home/mezuro/app" @@ -18,21 +18,26 @@ set :use_sudo, false # set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` -role :web, "ec2-54-224-143-159.compute-1.amazonaws.com" # Your HTTP server, Apache/etc -role :app, "ec2-54-224-143-159.compute-1.amazonaws.com" # This may be the same as your `Web` server -role :db, "ec2-54-224-143-159.compute-1.amazonaws.com", :primary => true # This is where Rails migrations will run - -# if you want to clean up old releases on each deploy uncomment this: -# after "deploy:restart", "deploy:cleanup" +role :web, "ec2-54-224-114-220.compute-1.amazonaws.com" # Your HTTP server, Apache/etc +role :app, "ec2-54-224-114-220.compute-1.amazonaws.com" # This may be the same as your `Web` server +role :db, "ec2-54-224-114-220.compute-1.amazonaws.com", :primary => true # This is where Rails migrations will run -# if you're still using the script/reaper helper you will need -# these http://github.com/rails/irs_process_scripts +before 'deploy:setup', 'rvm:install_rvm' # install RVM +before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR: +before 'deploy:setup', 'rvm:create_gemset' # only create gemset +after 'deploy:assets:symlink', 'deploy:config_symlinks' +after 'deploy:restart', "deploy:cleanup" -# If you are using Passenger mod_rails uncomment this: namespace :deploy do - task :start do ; end - task :stop do ; end - task :restart, :roles => :app, :except => { :no_release => true } do - run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" - end + task :start do ; end + + task :stop do ; end + + task :restart, :roles => :app, :except => { :no_release => true } do + run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" + end + + task :config_symlinks do + run "ln -s #{File.join(deploy_to, 'shared', 'config/database.yml')} #{File.join(release_path, 'config/database.yml')}" + end end \ No newline at end of file -- libgit2 0.21.2