Describe purpose rather than elements
This commit is contained in:
@@ -13,8 +13,8 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
"--detach",
|
"--detach",
|
||||||
"--restart unless-stopped",
|
"--restart unless-stopped",
|
||||||
"--log-opt", "max-size=#{MAX_LOG_SIZE}",
|
"--log-opt", "max-size=#{MAX_LOG_SIZE}",
|
||||||
"--name", service_with_version_and_destination_and_role,
|
"--name", container_name,
|
||||||
"-e", "MRSK_CONTAINER_NAME=\"#{service_with_version_and_destination_and_role}\"",
|
"-e", "MRSK_CONTAINER_NAME=\"#{container_name}\"",
|
||||||
*role.env_args,
|
*role.env_args,
|
||||||
*config.volume_args,
|
*config.volume_args,
|
||||||
*role.label_args,
|
*role.label_args,
|
||||||
@@ -24,7 +24,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def start
|
def start
|
||||||
docker :start, service_with_version_and_destination_and_role
|
docker :start, container_name
|
||||||
end
|
end
|
||||||
|
|
||||||
def stop(version: nil)
|
def stop(version: nil)
|
||||||
@@ -59,7 +59,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
def execute_in_existing_container(*command, interactive: false)
|
def execute_in_existing_container(*command, interactive: false)
|
||||||
docker :exec,
|
docker :exec,
|
||||||
("-it" if interactive),
|
("-it" if interactive),
|
||||||
service_with_version_and_destination_and_role,
|
container_name,
|
||||||
*command
|
*command
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
|
|
||||||
def remove_container(version:)
|
def remove_container(version:)
|
||||||
pipe \
|
pipe \
|
||||||
container_id_for(container_name: service_with_version_and_destination_and_role(version)),
|
container_id_for(container_name: container_name(version)),
|
||||||
xargs(docker(:container, :rm))
|
xargs(docker(:container, :rm))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -122,12 +122,12 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def service_with_version_and_destination_and_role(version = nil)
|
def container_name(version = nil)
|
||||||
[ config.service, role, config.destination, version || config.version ].compact.join("-")
|
[ config.service, role, config.destination, version || config.version ].compact.join("-")
|
||||||
end
|
end
|
||||||
|
|
||||||
def container_id_for_version(version)
|
def container_id_for_version(version)
|
||||||
container_id_for(container_name: service_with_version_and_destination_and_role(version))
|
container_id_for(container_name: container_name(version))
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_args
|
def filter_args
|
||||||
|
|||||||
Reference in New Issue
Block a user