Permalink
Browse files

deploy and env/prod

  • Loading branch information...
1 parent 8169ef4 commit f6c13d1215910a2c31a7eb5a187cf3109ab776cb Ace Suares committed Jun 4, 2012
Showing with 26 additions and 7 deletions.
  1. +12 −0 bin/inline_forms
  2. +13 −6 lib/generators/templates/deploy.rb
  3. +1 −1 lib/inline_forms/version.rb
View
@@ -211,6 +211,18 @@ precomp = "
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
#{app_name}::Application.configure do
config.assets.precompile += %w( inline_forms_application.js inline_forms_application.css devise.css )
+ # Fallback to assets pipeline if a precompiled asset is missed, we need this for ckeditor
+ config.assets.compile = true
+ # for devise
+ config.action_mailer.default_url_options = { :protocol => 'https', :host => 'YOURHOSTNAME' }
+
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.smtp_settings = {
+ :address => 'YOURMAILSERVER',
+ :enable_starttls_auto => true,
+ :password => 'YOURPASSWORD',
+ :user_name => 'YOURUSERNAME'
+ }
end
\n"
File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
@@ -12,10 +12,6 @@
set :domain, "YOUR_HOST_NAME"
set :user, "YOUR_USERNAME_ON_THE_HOST"
-#
-
-set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") # Read from local system
-
set :bundle_flags, "--deployment"
set :use_sudo, false
@@ -39,15 +35,24 @@
before 'deploy:setup', 'rvm:install_rvm'
before 'deploy:setup', 'rvm:install_ruby'
-after "deploy:update_code", "deploy:fix_stuff"
+before "deploy:assets:precompile", "deploy:fix_stuff"
namespace :deploy do
desc "Zero-downtime restart of Unicorn"
- task :restart, :except => { :no_release => true } do
+ task :zero_restart, :except => { :no_release => true } do
run "kill -s USR2 `cat #{shared_path}/pids/unicorn.pid`"
end
+ desc "Downtime restart of Unicorn"
+ task :restart, :except => { :no_release => true } do
+ run "kill -s KILL `cat #{shared_path}/pids/unicorn.pid`"
+ sleep 10
+ run "rvm rvmrc trust #{current_release}"
+ run "cd #{current_path} ; bundle exec r193_unicorn -c #{current_path}/config/unicorn.rb -D -E production"
+ end
+
+
desc "Start unicorn"
task :start, :except => { :no_release => true } do
run "rvm rvmrc trust #{current_release}"
@@ -69,6 +74,8 @@
run "cd #{shared_path} && mkdir -p log"
run "cd #{shared_path} && mkdir -p sockets"
run "ln -s #{shared_path}/sockets #{release_path}/tmp/sockets"
+ run "cd #{shared_path} && mkdir -p uploads"
+ run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
raise "Rails environment not set" unless rails_env
run "cd #{release_path} && RAILS_ENV=#{rails_env} bundle exec rails g ckeditor:install "
end
@@ -1,4 +1,4 @@
# -*- encoding : utf-8 -*-
module InlineForms
- VERSION = "1.3.39"
+ VERSION = "1.3.40"
end

0 comments on commit f6c13d1

Please sign in to comment.