Add option to see combined config

Easier to realize how merged configs appear
This commit is contained in:
David Heinemeier Hansson
2023-01-17 13:39:33 +01:00
parent 9a84460754
commit 3c6309b4dd
2 changed files with 21 additions and 0 deletions

View File

@@ -44,6 +44,13 @@ class Mrsk::Cli::Main < Mrsk::Cli::Base
invoke "mrsk:cli:app:details"
end
desc "config", "Show combined config"
def config
run_locally do
pp MRSK.config.to_h
end
end
desc "install", "Create config stub in config/deploy.yml and binstub in bin/mrsk"
option :skip_binstub, type: :boolean, default: false, desc: "Skip adding MRSK to the Gemfile and creating bin/mrsk binstub"
def install

View File

@@ -112,6 +112,20 @@ class Mrsk::Configuration
ENV["RAILS_MASTER_KEY"] || File.read(Pathname.new(File.expand_path("config/master.key")))
end
def to_h
{
roles: role_names,
hosts: hosts,
primary_host: primary_host,
version: version,
repository: repository,
absolute_image: absolute_image,
service_with_version: service_with_version,
env_args: env_args,
ssh_options: ssh_options
}
end
private
attr_accessor :config