This Capistrano plugin is designed to clear a cache on your instance with Rails app. capistrano-rails requires Capistrano 3.
Add this line to your application's Gemfile:
gem 'capistrano-cache', require: false
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-cache
And add that line to your Capfile
:
require 'capistrano/cache'
By default, a cache will be cleared on an :app
role so please add it to your Capistrano environment config file for ex:
server '[email protected]',
user: 'deployer',
roles: %w[app db web]
After installation, you can run a Capistrano task on any of yours environments stages:
cap production cache:clear
This gem will, by default add a hook to run a cache:clear
task after each deploy.
You can change this behaviour by adding this line to your deploy.rb
file:
set :clear_cache_after_deploy, true # by default or false
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
The gem is available as open source under the terms of the MIT License.