If you have different users for different servers, don't use set :user. Encode the username into the server definition...
As we get ready to upgrade our servers I thought it’d be a good time to upgrade our deployment...
...you say... before 'deploy:update_code', 'db:dump' after 'deploy:symlink', 'craken:install' # Capistrano 2.9.0 after 'deploy:create_symlink', 'craken:install' # Capistrano 2.12.0 after 'deploy:restart', 'db:show_dump...
...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...
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...
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...
...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...
...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...
...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...
Don't use a version without v prefix. This is currently not supported by capistrano-opscomplete. Warning Don't use a nondeterministic version like lts/gallium. This is not supported...
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...
...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...
...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...
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...
...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...
You can call bin/webpack explicitely to compile files to public/packs. When deploying with Capistrano this is done automatically by the compile:assets task. Why Webpacker sometimes does not re...
...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...
...group :deploy do gem 'whenever', require: false end Add it to your config/deploy.rb: For Capistrano 2 set :application, 'PROJECT_NAME' # might be already set set :whenever_command, "bundle exec whenever...
...to run cronjobs on the :db server. That's just fine for us. For Capistrano 3 set :application, 'PROJECT_NAME' # might be already set set :whenever_roles , [:cron] set :whenever...
...your deploy.rb add this: require 'backports/1.9.2/array/select' Background You propably have an older version of Capistrano and thereby an older version of net-ssh which is used by Capistrano to connect...
...proxy env variable, Bundler will also look for a http_proxy env variable. With Capistrano Ideally the server you're deploying on exports an https_proxy variable for all shells...
...t have control over the server setup, you can also add this to your Capistrano config: set :bundle_env_variables, { 'https_proxy' => 'http://myproxy...
deploy-to-production now calls Capistrano with bundle exec since we started to bundle Capistrano in all projects...
Guided deployment, including push, merge, switch branches. Does nothing without confirmation. geordi capistrano Run something for all Capistrano environments, e.g. geordi cap deploy geordi setup -t -d staging...
...mentioned in the BUNDLED_WITH block: BUNDLED WITH 1.17.1 This broke during deployment while Capistrano tries to run bundle --deployment --quiet --without development test. On our development machines bundle install...