Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Capistrano-ext support + other #3

Closed
wants to merge 3 commits into from

2 participants

@elmatou

Hi,
Some features I need.

  • Support Multistage from capistrano-ext for rails tasks
  • Support Passenger standalone mode (if you need several ruby version behind the same apache server)

fell free to cherry pick !

I tested these in situ, as ther is no specs.

@elmatou

I thought you were interested by these features :-(
nevermind, I use my fork ;-)

@nesquena
Owner

Sorry, I had been using this change but never pulled it in because I forgot. Just merged in all your changes and bumped the gem. Thanks!

@nesquena nesquena closed this
@elmatou

That was a long shot ! but everythings fine.

See you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 21, 2011
  1. @elmatou

    Ignore Rubymine files

    elmatou authored
  2. @elmatou
  3. @elmatou
This page is out of date. Refresh to see the latest.
View
3  .gitignore
@@ -1,3 +1,4 @@
.DS_Store
pkg*
-.svn
+.svn
+/.idea/
View
31 lib/cap_recipes/tasks/passenger/manage.rb
@@ -20,4 +20,35 @@
end
end
+
+ namespace :passenger do
+
+ desc "Standalone mode for passenger"
+ namespace :standalone do
+
+ desc "Starts the standalone passenger server"
+ task :start do
+ run "cd #{current_path} && passenger start -a 127.0.0.1 -p 3000 -d -e #{stage_or_production}"
+ end
+
+ desc "Stops the standalone passenger server"
+ task :stop do
+ run "cd #{current_path} && passenger stop"
+ end
+
+ desc "Restarts the standalone passenger server"
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ run "cd #{current_path} && passenger stop"
+ run "cd #{current_path} && passenger start -a 127.0.0.1 -p 3000 -d -e #{stage_or_production}"
+ end
+
+ end
+
+ end
+ # ===============================================================
+ # Support for capistrano-ext
+ # ===============================================================
+ def stage_or_production
+ exists?(:stage) ? stage : "production"
+ end
end
View
14 lib/cap_recipes/tasks/rails/manage.rb
@@ -22,7 +22,7 @@
desc "Displays the production log from the server locally"
task :tail, :roles => :app do
- stream "tail -f #{shared_path}/log/production.log"
+ stream "tail -f #{shared_path}/log/#{stage_or_production}.log"
end
desc "Pings localhost to startup server"
@@ -38,14 +38,20 @@
desc "Clear file-based fragment and action caching"
task :log, :roles => :app do
puts "Sweeping all the log files"
- run "cd #{current_path} && #{sudo} rake log:clear RAILS_ENV=production"
+ run "cd #{current_path} && #{sudo} rake log:clear RAILS_ENV=#{stage_or_production}"
end
desc "Clear file-based fragment and action caching"
task :cache, :roles => :app do
puts "Sweeping the fragment and action cache stores"
- run "cd #{release_path} && #{sudo} rake tmp:cache:clear RAILS_ENV=production"
+ run "cd #{release_path} && #{sudo} rake tmp:cache:clear RAILS_ENV=#{stage_or_production}"
end
end
end
-end
+ # ===============================================================
+ # Support for capistrano-ext
+ # ===============================================================
+ def stage_or_production
+ exists?(:stage) ? stage : "production"
+ end
+end
Something went wrong with that request. Please try again.