Capistrano: Different usernames for each server

Posted Over 12 years ago by Henning Koch.
github.com

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

Deployment Script Spring Cleaning - GitHub

Posted Over 14 years ago by Lexy.
github.com

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

Capistrano 2: Which Capistrano hooks to use for events to happen on both "cap deploy" and "cap deploy:migrations"

Posted About 13 years ago by Arne Hartherz.

...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...

Clean up application servers when deploying

Posted Almost 11 years ago by Thomas Eisenbarth.

...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...

How to search through logs on staging or production environments

Posted About 7 years ago.

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...

Middleman configuration for Rails Developers

Posted Almost 7 years ago by Dominik Schöler.

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...

How to skip Sprockets asset compile during Capistrano deployment

Posted About 6 years ago by Arne Hartherz.

...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...

Capistrano + Rails: Automatically skipping asset compilation when assets have not changed

Posted Almost 6 years ago by Dominik Schöler.
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...

Webpack(er): A primer

Posted Almost 5 years ago by Tobias Kraze.

...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...

Documenting your Rails project's Node.js version in .nvmrc

Posted Almost 5 years ago by Henning Koch.

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...

Building web applications: Beyond the happy path

Posted Almost 8 years ago by Dominik Schöler.

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...

Migration from the Asset Pipeline to Webpacker

Posted About 5 years ago by Emanuel.

...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.

Deliver Paperclip attachments to authorized users only

Posted Over 13 years ago by Henning Koch.

...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...

Heads up: Deployment with newly generated SSH key (using ED25519) might fail

Posted About 1 year ago by Fabian Schwarz.

...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...

A simpler default controller implementation

Posted Over 10 years ago by Henning Koch.

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...

Bundler in deploy mode shares gems between patch-level Ruby versions

Posted About 4 years ago by Michael Leimstädtner.

...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...

When does Webpacker compile?

Posted About 3 years ago by Henning Koch.

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...

Geordi 1.3 released

Posted Over 8 years ago by Dominik Schöler.

...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...

Cronjobs: "Craken" is dead, long live "Whenever"

Posted Over 11 years ago by Tobias Kraze.

...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...

Net::SSH::Exception: could not settle on encryption_client algorithm

Posted Over 7 years ago by Thomas Eisenbarth.

...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...

Bundler: Install gems behind a proxy

Posted About 8 years ago by Henning Koch.

...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...

Update: Shell script to deploy changes to production and not shoot yourself in the foot

Posted Almost 12 years ago by Henning Koch.
makandracards.com

deploy-to-production now calls Capistrano with bundle exec since we started to bundle Capistrano in all projects...

Geordi hints

Posted Over 7 years ago by Dominik Schöler.
github.com

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...

During deployment: "You are trying to install in deployment mode after changing your Gemfile"

Posted About 5 years ago by Thomas Eisenbarth.

...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...