Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capistrano tasks #2

Open
alec-c4 opened this issue Sep 6, 2012 · 5 comments
Open

capistrano tasks #2

alec-c4 opened this issue Sep 6, 2012 · 5 comments

Comments

@alec-c4
Copy link

alec-c4 commented Sep 6, 2012

Could you add please capistrano tasks to enable maintance mode remotely?

@adamcrown
Copy link
Collaborator

We don't use Capistrano at all. So I doubt we'll find the time to add the functionality. But we'd be happy to accept any pull requests.

@scottkf
Copy link

scottkf commented Jan 6, 2013

Example capistrano tasks:

namespace :maintenance do
  desc "Maintenance start"
  task :on, :roles => :web do
    on_rollback { run "rm #{current_path}/tmp/maintenance.yml" }
    page = File.read("config/maintenance.yml")
    put page, "#{current_path}/tmp/maintenance.yml", :mode => 0644
  end

  desc "Maintenance stop"
  task :off, :roles => :web do
    run "rm #{release_path}/tmp/maintenance.yml"
  end
end

@alec-c4
Copy link
Author

alec-c4 commented Jan 16, 2013

huh, it'll great to meet this hack on project wiki :)

@nfedyashev
Copy link

@scottkf Thanks!

@masciugo
Copy link

masciugo commented Oct 3, 2014

my tasks for capistrano3

namespace :maintenance do
  desc "Maintenance start (edit config/maintenance.yml to provide parameters)"
  task :start do
    on roles(:web) do
      upload! "config/maintenance.yml", "#{current_path}/tmp/maintenance.yml"
    end
  end

  desc "Maintenance stop"
  task :stop do
    on roles(:web) do
      execute "rm #{current_path}/tmp/maintenance.yml"
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants