diff --git a/Capfile b/Capfile new file mode 100644 index 0000000..f65237f --- /dev/null +++ b/Capfile @@ -0,0 +1,5 @@ +load 'deploy' +# Uncomment if you are using Rails' asset pipeline +load 'deploy/assets' +Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } +load 'config/deploy' # remove this line to skip loading any of the default tasks diff --git a/Gemfile b/Gemfile index 55cbe8d..f823392 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ end gem 'jquery-rails' -# gem 'capistrano' +gem 'capistrano' #gem "bluecloth" gem "redcarpet" diff --git a/Gemfile.lock b/Gemfile.lock index 6f02b4b..2c9df96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,6 +33,12 @@ GEM bson_ext (1.6.4) bson (~> 1.6.4) builder (3.0.0) + capistrano (2.11.2) + highline + net-scp (>= 1.0.0) + net-sftp (>= 2.0.0) + net-ssh (>= 2.0.14) + net-ssh-gateway (>= 1.1.0) carrierwave (0.6.2) activemodel (>= 3.2.0) activesupport (>= 3.2.0) @@ -51,6 +57,7 @@ GEM erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) + highline (1.6.11) hike (1.2.1) i18n (0.6.0) journey (1.0.4) @@ -72,6 +79,13 @@ GEM mongo (<= 1.6.2) tzinfo (~> 0.3.22) multi_json (1.3.6) + net-scp (1.0.4) + net-ssh (>= 1.99.1) + net-sftp (2.0.5) + net-ssh (>= 2.0.9) + net-ssh (2.3.0) + net-ssh-gateway (1.1.0) + net-ssh (>= 1.99.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) @@ -140,6 +154,7 @@ PLATFORMS DEPENDENCIES bson_ext + capistrano carrierwave-mongoid coffee-rails (~> 3.2.1) database_cleaner diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 0000000..95fdfb1 --- /dev/null +++ b/config/deploy.rb @@ -0,0 +1,34 @@ +require 'rvm/capistrano' +require 'bundler/capistrano' +#default_run_options[:shell] = '/bin/bash' +default_run_options[:pty] = true +set :application, "wblog" +set :repository, "git://github.com/windy/wblog.git" +set :user, "ruby" +set :use_sudo, false + +set :rvm_ruby_string, '1.9.3-p194' +set :rvm_type, :system +set :keep_releases, 5 + +set :scm, :git +set :branch, "master" +set :deploy_via, :remote_cache +# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` + +role :web, "yafeilee.me" # Your HTTP server, Apache/etc +role :app, "yafeilee.me" # This may be the same as your `Web` server +role :db, "yafeilee.me", :primary => true # This is where Rails migrations will run +#role :db, "your slave db-server here" +# +set :deploy_to, "/home/ruby/app_wblog" + + +# 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 + end