Grouping + ordering
This commit is contained in:
@@ -16,6 +16,18 @@ class Kamal::Configuration::Role
|
|||||||
@hosts ||= extract_hosts_from_config
|
@hosts ||= extract_hosts_from_config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cmd
|
||||||
|
specializations["cmd"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def option_args
|
||||||
|
if args = specializations["options"]
|
||||||
|
optionize args
|
||||||
|
else
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def labels
|
def labels
|
||||||
default_labels.merge(traefik_labels).merge(custom_labels)
|
default_labels.merge(traefik_labels).merge(custom_labels)
|
||||||
end
|
end
|
||||||
@@ -24,6 +36,7 @@ class Kamal::Configuration::Role
|
|||||||
argumentize "--label", labels
|
argumentize "--label", labels
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def env
|
def env
|
||||||
if config.env && config.env["secret"]
|
if config.env && config.env["secret"]
|
||||||
merged_env_with_secrets
|
merged_env_with_secrets
|
||||||
@@ -52,6 +65,7 @@ class Kamal::Configuration::Role
|
|||||||
asset_volume&.docker_args
|
asset_volume&.docker_args
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def health_check_args(cord: true)
|
def health_check_args(cord: true)
|
||||||
if health_check_cmd.present?
|
if health_check_cmd.present?
|
||||||
if cord && uses_cord?
|
if cord && uses_cord?
|
||||||
@@ -77,6 +91,12 @@ class Kamal::Configuration::Role
|
|||||||
health_check_options["interval"] || "1s"
|
health_check_options["interval"] || "1s"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def running_traefik?
|
||||||
|
name.web? || specializations["traefik"]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def uses_cord?
|
def uses_cord?
|
||||||
running_traefik? && cord_volume && health_check_cmd.present?
|
running_traefik? && cord_volume && health_check_cmd.present?
|
||||||
end
|
end
|
||||||
@@ -106,22 +126,6 @@ class Kamal::Configuration::Role
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def cmd
|
|
||||||
specializations["cmd"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def option_args
|
|
||||||
if args = specializations["options"]
|
|
||||||
optionize args
|
|
||||||
else
|
|
||||||
[]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def running_traefik?
|
|
||||||
name.web? || specializations["traefik"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def container_name(version = nil)
|
def container_name(version = nil)
|
||||||
[ container_prefix, version || config.version ].compact.join("-")
|
[ container_prefix, version || config.version ].compact.join("-")
|
||||||
end
|
end
|
||||||
@@ -130,6 +134,7 @@ class Kamal::Configuration::Role
|
|||||||
[ config.service, name, config.destination ].compact.join("-")
|
[ config.service, name, config.destination ].compact.join("-")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def asset_path
|
def asset_path
|
||||||
specializations["asset_path"] || config.asset_path
|
specializations["asset_path"] || config.asset_path
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user