Giter Club home page Giter Club logo

maintenance's Introduction

Capistrano: A deployment automation tool built on Ruby, Rake, and SSH.

Gem Version Build Status Code Climate CodersClan

Capistrano is a framework for building automated deployment scripts. Although Capistrano itself is written in Ruby, it can easily be used to deploy projects of any language or framework, be it Rails, Java, or PHP.

Once installed, Capistrano gives you a cap tool to perform your deployments from the comfort of your command line.

$ cd my-capistrano-enabled-project
$ cap production deploy

When you run cap, Capistrano dutifully connects to your server(s) via SSH and executes the steps necessary to deploy your project. You can define those steps yourself by writing Rake tasks, or by using pre-built task libraries provided by the Capistrano community.

Tasks are simple to make. Here's an example:

task :restart_sidekiq do
  on roles(:worker) do
    execute :service, "sidekiq restart"
  end
end
after "deploy:published", "restart_sidekiq"

Note: This documentation is for the current version of Capistrano (3.x). If you are looking for Capistrano 2.x documentation, you can find it in this archive.


Contents

Features

There are many ways to automate deployments, from simple rsync bash scripts to complex containerized toolchains. Capistrano sits somewhere in the middle: it automates what you already know how to do manually with SSH, but in a repeatable, scalable fashion. There is no magic here!

Here's what makes Capistrano great:

Strong conventions

Capistrano defines a standard deployment process that all Capistrano-enabled projects follow by default. You don't have to decide how to structure your scripts, where deployed files should be placed on the server, or how to perform common tasks: Capistrano has done this work for you.

Multiple stages

Define your deployment once, and then easily parameterize it for multiple stages (environments), e.g. qa, staging, and production. No copy-and-paste necessary: you only need to specify what is different for each stage, like IP addresses.

Parallel execution

Deploying to a fleet of app servers? Capistrano can run each deployment task concurrently across those servers and uses connection pooling for speed.

Server roles

Your application may need many different types of servers: a database server, an app server, two web servers, and a job queue work server, for example. Capistrano lets you tag each server with one or more roles, so you can control what tasks are executed where.

Community driven

Capistrano is easily extensible using the rubygems package manager. Deploying a Rails app? Wordpress? Laravel? Chances are, someone has already written Capistrano tasks for your framework of choice and has distributed it as a gem. Many Ruby projects also come with Capistrano tasks built-in.

It's just SSH

Everything in Capistrano comes down to running SSH commands on remote servers. On the one hand, that makes Capistrano simple. On the other hand, if you aren't comfortable SSH-ing into a Linux box and doing stuff on the command-line, then Capistrano is probably not for you.

Gotchas

While Capistrano ships with a strong set of conventions that are common for all types of deployments, it needs help understanding the specifics of your project, and there are some things Capistrano is not suited to do.

Project specifics

Out of the box, Capistrano can deploy your code to server(s), but it does not know how to execute your code. Does foreman need to be run? Does Apache need to be restarted? You'll need to tell Capistrano how to do this part by writing these deployment steps yourself, or by finding a gem in the Capistrano community that does it for you.

Key-based SSH

Capistrano depends on connecting to your server(s) with SSH using key-based (i.e. password-less) authentication. You'll need this working before you can use Capistrano.

Provisioning

Likewise, your server(s) will likely need supporting software installed before you can perform a deployment. Capistrano itself has no requirements other than SSH, but your application probably needs database software, a web server like Apache or Nginx, and a language runtime like Java, Ruby, or PHP. These server provisioning steps are not done by Capistrano.

sudo, etc.

Capistrano is designed to deploy using a single, non-privileged SSH user, using a non-interactive SSH session. If your deployment requires sudo, interactive prompts, authenticating as one user but running commands as another, you can probably accomplish this with Capistrano, but it may be difficult. Your automated deployments will be much smoother if you can avoid such requirements.

Shells

Capistrano 3 expects a POSIX shell like Bash or Sh. Shells like tcsh, csh, and such may work, but probably will not.

Quick start

Requirements

  • Ruby version 2.0 or higher on your local machine (MRI or Rubinius)
  • A project that uses source control (Git, Mercurial, and Subversion support is built-in)
  • The SCM binaries (e.g. git, hg) needed to check out your project must be installed on the server(s) you are deploying to
  • Bundler, along with a Gemfile for your project, are recommended

Install the Capistrano gem

Add Capistrano to your project's Gemfile using require: false:

group :development do
  gem "capistrano", "~> 3.17", require: false
end

Then run Bundler to ensure Capistrano is downloaded and installed:

$ bundle install

"Capify" your project

Make sure your project doesn't already have a "Capfile" or "capfile" present. Then run:

$ bundle exec cap install

This creates all the necessary configuration files and directory structure for a Capistrano-enabled project with two stages, staging and production:

├── Capfile
├── config
│   ├── deploy
│   │   ├── production.rb
│   │   └── staging.rb
│   └── deploy.rb
└── lib
    └── capistrano
            └── tasks

To customize the stages that are created, use:

$ bundle exec cap install STAGES=local,sandbox,qa,production

Note that the files that Capistrano creates are simply templates to get you started. Make sure to edit the deploy.rb and stage files so that they contain values appropriate for your project and your target servers.

Command-line usage

# list all available tasks
$ bundle exec cap -T

# deploy to the staging environment
$ bundle exec cap staging deploy

# deploy to the production environment
$ bundle exec cap production deploy

# simulate deploying to the production environment
# does not actually do anything
$ bundle exec cap production deploy --dry-run

# list task dependencies
$ bundle exec cap production deploy --prereqs

# trace through task invocations
$ bundle exec cap production deploy --trace

# lists all config variable before deployment tasks
$ bundle exec cap production deploy --print-config-variables

Finding help and documentation

Capistrano is a large project encompassing multiple GitHub repositories and a community of plugins, and it can be overwhelming when you are just getting started. Here are resources that can help:

Related GitHub repositories:

  • capistrano/sshkit provides the SSH behavior that underlies Capistrano (when you use execute in a Capistrano task, you are using SSHKit)
  • capistrano/rails is a very popular gem that adds Ruby on Rails deployment tasks
  • mattbrictson/airbrussh provides Capistrano's default log formatting

GitHub issues are for bug reports and feature requests. Please refer to the CONTRIBUTING document for guidelines on submitting GitHub issues.

If you think you may have discovered a security vulnerability in Capistrano, do not open a GitHub issue. Instead, please send a report to [email protected].

How to contribute

Contributions to Capistrano, in the form of code, documentation or idea, are gladly accepted. Read the DEVELOPMENT document to learn how to hack on Capistrano's code, run the tests, and contribute your first pull request.

License

MIT License (MIT)

Copyright (c) 2012-2020 Tom Clements, Lee Hambley

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

maintenance's People

Contributors

antage avatar aussidavid avatar bobziuchkovski avatar jage avatar kirs avatar lazyatom avatar mascott avatar mattbrictson avatar phoet avatar runar avatar seenmyfate avatar simoniong avatar sundi3yansyah avatar tjwallace avatar up_the_irons avatar yaotti avatar zoer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maintenance's Issues

Tasks not available?

I must be doing something wrong at the very basic level.

Gem is installed:

% bundle list | grep capis
  * capistrano (3.16.0)
  * capistrano-bundler (2.0.1)
  * capistrano-maintenance (1.2.1)
  * capistrano-passenger (0.2.1)
  * capistrano-rails (1.6.1)
  * capistrano-rbenv (2.2.0)

But I get:

% bundle exec cap staging maintenance:disable
(Backtrace restricted to imported tasks)
cap aborted!
Don't know how to build task 'maintenance:disable' (See the list of available tasks with `cap --tasks`)

(See full trace by running task with --trace)

And this is strange:

% cap production doctor:gems

Gems

    capistrano           3.16.0
    airbrussh            1.4.0
    rake                 13.0.3
    sshkit               1.21.2
    net-ssh              6.1.0
    capistrano-bundler   2.0.1
    capistrano-passenger 0.2.1
    capistrano-rails     1.6.1
    capistrano-rbenv     2.2.0

Am I missing a step somewhere?

Version

Hi,

There was a previous capistrano-maintenance gem, which worked with Cap 2. It's last version is 0.0.4.

We have many projects and one gemserver. Some projects work with Cap 2 still, some with Cap 3. We packaged this gem for our own gemserver, which is currently at version 0.0.1.

This is now causing problems for us: running bundle update in our Cap 3 projects obtains the older capistrano-maintenance 0.0.4 gem.

For the first release of this gem, we suggest giving it version 0.0.5, because it's newer than the previous capistrano-maintenance gem.

With kind regards,

Vincent de Bruijn

Repo name

All capistrano/* repos are located in capistrano/gem-name and this one is capistrano/capistrano-gem-name.

@leehambley what about renaming it to capistrano/maintenance?

undefined method 'link_to'

$ cap staging maintenance:enable REASON="Testing" --trace

** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
Using airbrussh format.
Verbose output is being written to log/capistrano.log.
** Invoke bundler:map_bins (first_time)
** Invoke passenger:bundler:hook (first_time)
** Execute passenger:bundler:hook
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env
** Invoke rvm:hook (first_time)
** Invoke passenger:rvm:hook (first_time)
** Invoke passenger:test_which_passenger (first_time)
** Execute passenger:test_which_passenger
** Execute passenger:rvm:hook
** Execute rvm:hook
** Invoke rvm:check (first_time)
** Execute rvm:check
rvm 1.27.0 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
ruby-2.2.3
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
** Invoke maintenance:enable (first_time)
** Execute maintenance:enable
cap aborted!
NoMethodError: undefined method `link_to' for #<SSHKit::Backend::Netssh:0x007fb84ac6c870>
(erb):8:in `block (3 levels) in <top (required)>'
/Users/David/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/erb.rb:863:in `eval'
/Users/David/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/erb.rb:863:in `result'
/Users/David/.rvm/gems/ruby-2.2.3/gems/capistrano-maintenance-1.0.0/lib/capistrano/tasks/maintenance.rake:12:in `block (3 levels) in <top (required)>'
/Users/David/.rvm/gems/ruby-2.2.3/gems/sshkit-1.11.3/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/Users/David/.rvm/gems/ruby-2.2.3/gems/sshkit-1.11.3/lib/sshkit/backends/abstract.rb:29:in `run'
/Users/David/.rvm/gems/ruby-2.2.3/gems/sshkit-1.11.3/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => maintenance:enable

undefined method on_rollback

Having trouble with capistrano 3.1 and master of capistrano-maintenance.

Output:

➤ cap local maintenance:enable
DEBUG [9d6d6ad5] Running /usr/bin/env [ ! -d /opt/rbenv/versions/2.1.0 ] on local
DEBUG [9d6d6ad5] Command: [ ! -d /opt/rbenv/versions/2.1.0 ]
DEBUG [9d6d6ad5] Finished in 0.030 seconds with exit status 1 (failed).
cap aborted!
undefined method `on_rollback' for #<SSHKit::Backend::Netssh:0x007fba3c463db0>
/Users/dan/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/bundler/gems/capistrano-maintenance-75d1a315e38d/lib/capistrano/tasks/maintenance.rake:6:in `block (3 levels) in <top (required)>'
/Users/dan/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'                                        
/Users/dan/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/dan/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => maintenance:enable

capistrano-maintenace breaks 'cap' binstubs calls

cap -T
cap aborted!
LoadError: cannot load such file -- capistrano/maintenance
Capfile:26:in <top (required)>' .rbenv/versions/2.0.0-p353/bin/cap:23:inload'
.rbenv/versions/2.0.0-p353/bin/cap:23:in `

'
(See full trace by running task with --trace)

Using:
rbenv
capistrano 3
ruby2
rails

Before installing the gem it worked without a problem.

Error with Cap 3.1 and Ruby 2.1.1

Followed the README.md

  • ~> Rails 4.0
  • ~> Capistrano 3.1
  • Cap Maintenance 0.0.4

Got the following error:

/.rvm/gems/ruby-2.1.1/gems/capistrano-maintenance-0.0.4/lib/capistrano/maintenance.rb:3:in `<top (required)>': uninitialized constant Capistrano (NameError)
from /Users/ace/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:85:in `require'
from /Users/ace/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:85:in `rescue in block in require'
from /Users/ace/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:68:in `block in require'
from /Users/ace/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `each'
from /Users/ace/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `require'
from /Users/ace/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler.rb:131:in `require'
from /Users/ace/Projects/company/config/application.rb:7:in `<top (required)>'
from /Users/ace/.rvm/gems/ruby-2.1.1/gems/railties-4.0.2/lib/rails/commands.rb:60:in `require'
from /Users/ace/.rvm/gems/ruby-2.1.1/gems/railties-4.0.2/lib/rails/commands.rb:60:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

Conflicts with capistrano-rails

Not sure why, but with a Ruby 2.0.0p195, Rails 4.0.4 application I'm getting errors when including capistrano-rails in my Gemfile.

The relevant part of my Gemfile is:

gem 'capistrano-rails', group: [:development]
gem 'capistrano-maintenance', github: "capistrano/capistrano-maintenance", group: [:development]

And in Gemfile.lock is:

GIT
  remote: git://github.com/capistrano/capistrano-maintenance.git
  revision: d875206fd91c50f275350e0758bb5939d273637d
  specs:
    capistrano-maintenance (0.0.1)
      capistrano (>= 3.0)

    capistrano (3.2.1)
      i18n
      rake (>= 10.0.0)
      sshkit (~> 1.3)
    capistrano-bundler (1.1.2)
      capistrano (~> 3.0)
      sshkit (~> 1.2)
    capistrano-rails (1.1.1)
      capistrano (~> 3.1)
      capistrano-bundler (~> 1.1)

When trying to run the application in development mode, I get the following error:

brimstone:application mezza9$ be rails s
/Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/bundler/gems/capistrano-maintenance-d875206fd91c/lib/capistrano/tasks/maintenance.rake:1:in `<top (required)>': undefined method `namespace' for main:Object (NoMethodError)
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:223:in `load'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:223:in `block in load'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:223:in `load'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/bundler/gems/capistrano-maintenance-d875206fd91c/lib/capistrano/maintenance.rb:1:in `<top (required)>'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `require'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `rescue in block in require'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:66:in `block in require'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
  from /Users/mezza9/Repos/Bitbucket/application/config/application.rb:7:in `<top (required)>'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/railties-4.0.4/lib/rails/commands.rb:74:in `require'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/railties-4.0.4/lib/rails/commands.rb:74:in `block in <top (required)>'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/railties-4.0.4/lib/rails/commands.rb:71:in `tap'
  from /Users/mezza9/.rvm/gems/ruby-2.0.0-p195@application/gems/railties-4.0.4/lib/rails/commands.rb:71:in `<top (required)>'
  from bin/rails:4:in `require'
  from bin/rails:4:in `<main>'

No such file or directory on upload

On running "bundle exec cap staging maintenance:enable" I get:

DEBUG [572c5897] Command: [ ! -d ~/rails/shared/public/system/ ]
DEBUG [572c5897] Finished in 0.250 seconds with exit status 1 (failed).
DEBUG Uploading ~/rails/shared/public/system/maintenance.html 0.0%
cap aborted!
scp: ~/rails/shared/public/system/maintenance.html: No such file or directory

Within the Rails console I ran "result=ERB.new(File.read('app/views/maintenance.html.erb')).result(binding)" which succesfully gives me a HTML template string.

The "maintenance:disable" task runs fine after having uploaded a page manually.

All other default and custom Capistrano tasks within my project run fine.

Gemspec requires a missing file

capistrano/maintenance/version does not exist which is required by the gemspec and I assume should set Capistrano::Maintenance::VERSION which is then used in the gempsec

Error

[ 2017-02-11 12:15:39.0290 18902/7fd425450700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/tarbiyah/staging/current: An error occurred while starting up the preloader.
  Error ID: 46d1c008
  Error details saved to: /tmp/passenger-error-d43sGk.html
  Message from application: undefined method `namespace' for main:Object (NoMethodError)
  /var/www/tarbiyah/staging/shared/bundle/ruby/2.3.0/gems/capistrano-maintenance-1.1.0/lib/capistrano/tasks/maintenance.rake:1:in `<top (required)>'
  /var/www/tarbiyah/staging/shared/bundle/ruby/2.3.0/gems/capistrano-maintenance-1.1.0/lib/capistrano/maintenance.rb:1:in `load'
  /var/www/tarbiyah/staging/shared/bundle/ruby/2.3.0/gems/capistrano-maintenance-1.1.0/lib/capistrano/maintenance.rb:1:in `<top (required)>'
  /home/imidsac/.rvm/gems/ruby-2.3.3/gems/bundler-1.13.6/lib/bundler/runtime.rb:105:in `require'
  /home/imidsac/.rvm/gems/ruby-2.3.3/gems/bundler-1.13.6/lib/bundler/runtime.rb:105:in `rescue in block in require'
  /home/imidsac/.rvm/gems/ruby-2.3.3/gems/bundler-1.13.6/lib/bundler/runtime.rb:82:in `block in require'
  /home/imidsac/.rvm/gems/ruby-2.3.3/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
  /home/imidsac/.rvm/gems/ruby-2.3.3/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
  /home/imidsac/.rvm/gems/ruby-2.3.3/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
  /var/www/tarbiyah/staging/releases/20170211120631/config/application.rb:7:in `<top (required)>'
  /var/www/tarbiyah/staging/releases/20170211120631/config/environment.rb:2:in `require_relative'
  /var/www/tarbiyah/staging/releases/20170211120631/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require_relative'
  config.ru:3:in `block in <main>'
  /var/www/tarbiyah/staging/shared/bundle/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
  /var/www/tarbiyah/staging/shared/bundle/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

Q: Run from deployment machine?

I have a cronjob that needs to do some downtime work, I'd love if it were able to wrap itself the maintenance:enable and disable tasks, using the same logic ordinarily used for turning on maintenance mode 'manually', to keep things DRY and consistent.

I guess I'd have to add cap and cap plugins to the production gem group... and then just have my cron job actually run bundle exec cap maintenance:enable from the production machine itself? I guess it would still be ssh'ing, even though it's on the same machine it's ssh'ing too, so would have to make sure to set up ssh keys for localhost login. I guess?

Does this make any sense at all? Is it a terrible idea? Is there any better way to do this?

Thanks for any advice!

NoMethodError when starting rails server

using the instructions supplied in the readme results in the following error when starting rails server

/Users/russell/.rvm/gems/ruby-2.0.0-p353@baseapp/bundler/gems/capistrano-maintenance-1b46e54de753/lib/capistrano/tasks/maintenance.rake:1:in <top (required)>': undefined methodnamespace' for main:Object (NoMethodError)

changing the bundler line to require: false fixes this

gem 'capistrano-maintenance', github: "capistrano/capistrano-maintenance", require: false

Is it localized

If I use t('maintenance_message') in my erb file, will it look up the translations via the rails_i18n gem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.