Skip to content

Instantly share code, notes, and snippets.

@jimworm
Created April 3, 2023 15:30
Show Gist options
  • Save jimworm/fcd73db4b01bb9fbe4497ccd70351e45 to your computer and use it in GitHub Desktop.
Save jimworm/fcd73db4b01bb9fbe4497ccd70351e45 to your computer and use it in GitHub Desktop.
using stage configuration variables in capistrano append
# abuse capistrano variable validators to
# use stage configs with the non-lazy #append
# this bit sets a global config before the stage is loaded
append :linked_files, 'config/database.yml', 'config/other.yml'
# this bit will run after the variable you need is set
validate :rails_env do |_, value|
append :linked_files, "config/credentials/#{value}.key"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment