Sha256: 2ef4339f3236e01029e77bae64e22ddcb67e8659394a7e2ba3bbc47ea2171883

Contents?: true

Size: 603 Bytes

Versions: 39

Compression:

Stored size: 603 Bytes

Contents

namespace :maintenance do
  desc "Enable maintenance: set MESSAGE='We should be back in approximately 2 hours'"
  task :enable do
    on roles(:web) do |host, user|
      within current_path do
        message = ENV["MESSAGE"] || ""
        upload! StringIO.new(message), "#{current_path}/tmp/maintenance.txt"
        invoke 'deploy:restart'
      end
    end
  end

  desc "Disable maintenance mode"
  task :disable do
    on roles(:web) do |host, user|
      within current_path do
        execute :rm, "#{current_path}/tmp/maintenance.txt"
        invoke 'deploy:restart'
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
jefferies_tube-1.7.1 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.7.0 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.9 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.8 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.7 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.6 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.5 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.4 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.3.2 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.3.1 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.3 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.2 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.1 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.6.0 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.5.4 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.5.3 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.5.2 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.5 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.4 lib/jefferies_tube/capistrano/maintenance.rb
jefferies_tube-1.3 lib/jefferies_tube/capistrano/maintenance.rb