Add support for volumes
This commit is contained in:
@@ -10,6 +10,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
"--name", config.service_with_version,
|
||||
*rails_master_key_arg,
|
||||
*role.env_args,
|
||||
*config.volumes,
|
||||
*role.label_args,
|
||||
config.absolute_image,
|
||||
role.cmd
|
||||
@@ -43,6 +44,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
("-it" if interactive),
|
||||
*rails_master_key_arg,
|
||||
*config.env_args,
|
||||
*config.volumes,
|
||||
config.service_with_version,
|
||||
*command
|
||||
end
|
||||
@@ -53,6 +55,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
"--rm",
|
||||
*rails_master_key_arg,
|
||||
*config.env_args,
|
||||
*config.volumes,
|
||||
config.absolute_image,
|
||||
*command
|
||||
end
|
||||
|
||||
@@ -40,7 +40,6 @@ 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
|
||||
@@ -61,7 +60,6 @@ class Mrsk::Configuration
|
||||
roles.select(&:running_traefik?).flat_map(&:hosts)
|
||||
end
|
||||
|
||||
|
||||
def version
|
||||
@version
|
||||
end
|
||||
@@ -78,7 +76,6 @@ class Mrsk::Configuration
|
||||
"#{service}-#{version}"
|
||||
end
|
||||
|
||||
|
||||
def env_args
|
||||
if config.env.present?
|
||||
argumentize_env_with_secrets(config.env)
|
||||
@@ -87,6 +84,12 @@ class Mrsk::Configuration
|
||||
end
|
||||
end
|
||||
|
||||
def volumes
|
||||
return unless config.volumes.present?
|
||||
|
||||
config.volumes.map { |volume| "--volume #{volume}" }
|
||||
end
|
||||
|
||||
def ssh_user
|
||||
config.ssh_user || "root"
|
||||
end
|
||||
@@ -110,11 +113,11 @@ class Mrsk::Configuration
|
||||
service_with_version: service_with_version,
|
||||
env_args: env_args,
|
||||
ssh_options: ssh_options,
|
||||
builder: config.builder
|
||||
builder: config.builder,
|
||||
volumes: volumes
|
||||
}.compact
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
attr_accessor :config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user