github.com

A collection of useful utilities for Capistrano deployments

I got these warnings while deploying a Rails 3.2 app with asset pipeline enabled: *** [err :: host.tld] find: `/opt/www/hollyapp.com/releases/20120503115342/public/images': No such...

In order to bring up a textual description of a Capistrano task you can say cap -e taskname ... where taskname is the name of the task you're not sure...

There is a conflict between current capistrano versions and the 2.5.1 net-ssh gem. Make sure you upgrade to 2.5.2, then it should work again...

github.com

Note: capistrano_colors was merged into Capistrano starting from v2.13.5. However, this requires Ruby 1.9+. If you cannot upgrade Capistrano to 2.13.5+ (e.g. because you're still running on Ruby...

...simply put capistrano_colors into your Gemfile and require 'capistrano_colors' in your config/deploy.rb file...

github.com

If you have different users for different servers, don't use set :user. Encode the username into the server definition...

github.com

As we get ready to upgrade our servers I thought it’d be a good time to upgrade our deployment...

...and re-use the previous release's assets. [1] That is especially easy via Capistrano. Capistrano will automatically symlink your release's public/assets to a shared directory, so all you...

...deploy:assets:precompile task. Put the following code where you'd put other custom Capistrano tasks (default is lib/capistrano/tasks/*.rake) if ENV['SKIP_ASSETS'] Rake::Task['deploy:assets:precompile'].clear...

makandracards.com

...to speed up deployment, asset precompilation can be skipped. This card automates the process. Capistrano 3 namespace :deploy do desc 'Automatically skip asset compile if possible' task :auto_skip_assets...

github.com

Installation Add this line to your application's Gemfile: gem 'capistrano', '~> 3.0' gem 'capistrano-maintenance', '~> 1.0' Add this line to you application's Capfile: require 'capistrano/maintenance'

...will make your application web-accessible again. Manual steps If you are still on capistrano 1, you can enable and disable the maintenance page manually. First, prepare a maintenance.html, for...

Running commands on multiple servers at the same time With a custom Capistrano task: CMD='zgrep -P "..." RAILS_ROOT/log/production.log' bundle exec cap production app:run_cmd See Capistrano...

...achieved and how to fix it. Theory When you deploy a new Ruby version with capistrano-opscomplete, it will take care of a few things: The new Ruby version is...

...anyway. Don't do this unless you absolutely need to. There is a taks in capistrano-opscomplete-0.6.4 which can do that for you (see below). In capistrano-opscomplete...

Carrierwave Go through our Carrierwave checklist if used. Maintenance Integrate and test the capistrano maintenance task. Accessibility Decide what effort you want to put in improving accessibility for physically...

gem 'bootstrap-sass' # If you want to use Bootstrap gem 'byebug' gem 'capistrano' gem 'capistrano-middleman', require: false config.rb activate :livereload activate :sprockets configure :build do activate :minify_css...

...Rails'ish webserver is already configured to deliver from. Note that you must not require capistrano-middleman manually, although stated in the gem's README. Doing so would screw the...

makandra dev

...the pack is application.js): = image_pack_tag('media/application/images/logo.png') Deployment Follow Configuring Webpacker deployments with Capistrano. Tests In your cucumber test, you will want to regenerate your assets before each test...

makandra Curriculum

...for a Rake task within a Rails app to depend on :environment. Understand that Capistrano tasks are also defined using the Rake DSL, but a Capistrano task is not automatically...

...only cleans up releases, not assets. In order to clean up assets, you can use capistrano-rails. Just require 'capistrano/rails' in Capfile and add the following config: # config/deploy.rb

...asset and remove any older versions. If you are using Webpacker, you need to configure capistrano-rails. If you are on Rails 3, you cannot use this to clean up...

...bundle exec rake assets:precompile. Remember to remove the folder public/packs afterwards. 11. Configure Capistrano and servers such that all servers share assets 12. Add a binstub for yarn if...

Remove require "sprockets/railtie" from application.rb Configure Deployment See Configuring Webpacker deployments with Capistrano. Deploy Check if your servers have the correct version of node and yarn installed.

...deployments, you only need to add storage to the linked_dirs in config/deploy.rb For Capistrano 2, add this to your config/deploy.rb: namespace :paperclip do desc "Create a storage folder for...

...before "deploy:setup", 'paperclip:create_storage' after "deploy:update_code", "paperclip:link_storage" For Capistrano 3, add the following (untested) to your config/deploy.rb: namespace :paperclip do desc "Create a storage...

...to upgrade to Sidekiq 6+ Setup Sidekiq and Redis Using Sidekiq with Procfile and Capistrano (example...

...please ensure you use version 5.2.0 or newer to ensure you can deploy via Capistrano. It's best to use the latest version, as there were multiple issues between...

etag { @@revision ||= File.read('REVISION') rescue nil } # Change all ETags after a new Capistrano release. etag { up.target } # Add this when you use Unpoly < 3 and optimize responses for render...

...algorithm instead of RSA (see Create a new SSH key pair), the deployment with Capistrano may fail with the following message: The deploy has failed with an error: unsupported key...

makandra dev

...be excluded from parallel runs, and run sequentially in a second run Support for Capistrano 2 AND 3 (will deploy without :migrations on Capistrano 3) Now requires a .firefox-version...

...Enable the given virtual host, disabling all others geordi ca[pistrano] COMMAND # Run a capistrano command on all deploy targets geordi cl[ean] # Remove unneeded files from the current directory...