diff --git a/README.md b/README.md index eba1eb96..7ecb41a9 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,6 @@ If the referenced secret ENVs are missing, the configuration will be halted with Note: Marking an ENV as secret currently only redacts its value in the output for MRSK. The ENV is still injected in the clear into the container at runtime. - ### Using volumes You can add custom volumes into the app containers using `volumes`: diff --git a/lib/mrsk/configuration.rb b/lib/mrsk/configuration.rb index ebf2e2d7..42129b63 100644 --- a/lib/mrsk/configuration.rb +++ b/lib/mrsk/configuration.rb @@ -40,6 +40,7 @@ class Mrsk::Configuration ensure_required_keys_present if validate end + def roles @roles ||= role_names.collect { |role_name| Role.new(role_name, config: self) } end @@ -60,6 +61,7 @@ class Mrsk::Configuration roles.select(&:running_traefik?).flat_map(&:hosts) end + def version @version end @@ -76,6 +78,7 @@ class Mrsk::Configuration "#{service}-#{version}" end + def env_args if config.env.present? argumentize_env_with_secrets(config.env) @@ -85,9 +88,11 @@ class Mrsk::Configuration end def volumes - return unless config.volumes.present? - - config.volumes.map { |volume| "--volume #{volume}" } + if config.volumes.present? + config.volumes.map { |volume| "--volume #{volume}" } + else + [] + end end def ssh_user @@ -118,6 +123,7 @@ class Mrsk::Configuration }.compact end + private attr_accessor :config