Skip to content

Instantly share code, notes, and snippets.

@andreyuhai
Last active February 22, 2020 23:06
Show Gist options
  • Save andreyuhai/b2971ef43e5ee4de8f5ee7a005c1d9e0 to your computer and use it in GitHub Desktop.
Save andreyuhai/b2971ef43e5ee4de8f5ee7a005c1d9e0 to your computer and use it in GitHub Desktop.
Deploying Rails 5.2 Applications with New Encrypted Credentials using Capistrano

Deploying Rails 5.2 Applications with New Encrypted Credentials using Capistrano

Source

  1. Copy config/master.key from local filesystem to the production server under <project_root>/shared/config/master.key.

  2. Configure capistrano’s config/deploy.rb to include this line:

set :linked_files, %w{config/master.key}

By doing this you’re telling Capistrano to symlink config/master.key to <project_root>/shared/config/master.key which contains the master key you’ve just copied to the server.

  1. Deploy app again and verify that deployment is successful.

  2. Commit this confguration changes. Don’t check-in config/master.key!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment