kamal 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kamal/cli/build.rb +4 -0
- data/lib/kamal/cli/proxy.rb +0 -12
- data/lib/kamal/commander/specifics.rb +6 -2
- data/lib/kamal/configuration/docs/proxy.yml +27 -5
- data/lib/kamal/configuration/proxy.rb +1 -0
- data/lib/kamal/configuration.rb +1 -1
- data/lib/kamal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa9cdc20d3b482b18687564bd8f45383a771d256153b69213923215ba94ebce
|
4
|
+
data.tar.gz: b2b617c75e5b3324916f49f40e1ab1dac43186de0568000bb768eca2d21a38cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6a7b11fd418414669e0477c9d3c3a30e9bbd39433ccc68e85df7bba9f97f96361168a1d780740321fdff1211ecd4c13262377759d25f88f37c2964d858789a
|
7
|
+
data.tar.gz: bafc9d379a59dc332f3e3f0a079d76db96a433742b3b17eb72b3b90dd28e37067d9f6d8db6c18af29723020bbc0aa53e49bacb203bdba76f6cee839379f886d2
|
data/lib/kamal/cli/build.rb
CHANGED
@@ -14,6 +14,10 @@ class Kamal::Cli::Build < Kamal::Cli::Base
|
|
14
14
|
def push
|
15
15
|
cli = self
|
16
16
|
|
17
|
+
# Ensure pre-connect hooks run before the build, they may needed for a remote builder
|
18
|
+
# or the pre-build hooks.
|
19
|
+
pre_connect_if_required
|
20
|
+
|
17
21
|
ensure_docker_installed
|
18
22
|
login_to_registry_locally
|
19
23
|
|
data/lib/kamal/cli/proxy.rb
CHANGED
@@ -120,18 +120,6 @@ class Kamal::Cli::Proxy < Kamal::Cli::Base
|
|
120
120
|
execute *KAMAL.proxy.ensure_apps_config_directory
|
121
121
|
|
122
122
|
execute *KAMAL.proxy.run
|
123
|
-
|
124
|
-
KAMAL.roles_on(host).select(&:running_proxy?).each do |role|
|
125
|
-
app = KAMAL.app(role: role, host: host)
|
126
|
-
|
127
|
-
version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
|
128
|
-
endpoint = capture_with_info(*app.container_id_for_version(version)).strip
|
129
|
-
|
130
|
-
if endpoint.present?
|
131
|
-
info "Deploying #{endpoint} for role `#{role}` on #{host}..."
|
132
|
-
execute *app.deploy(target: endpoint)
|
133
|
-
end
|
134
|
-
end
|
135
123
|
end
|
136
124
|
run_hook "post-proxy-reboot", hosts: host_list
|
137
125
|
end
|
@@ -11,7 +11,7 @@ class Kamal::Commander::Specifics
|
|
11
11
|
@primary_role = primary_or_first_role(roles_on(primary_host))
|
12
12
|
|
13
13
|
stable_sort!(roles) { |role| role == primary_role ? 0 : 1 }
|
14
|
-
|
14
|
+
sort_primary_role_hosts_first!(hosts)
|
15
15
|
end
|
16
16
|
|
17
17
|
def roles_on(host)
|
@@ -19,7 +19,7 @@ class Kamal::Commander::Specifics
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def app_hosts
|
22
|
-
config.app_hosts & specified_hosts
|
22
|
+
@app_hosts ||= sort_primary_role_hosts_first!(config.app_hosts & specified_hosts)
|
23
23
|
end
|
24
24
|
|
25
25
|
def proxy_hosts
|
@@ -55,4 +55,8 @@ class Kamal::Commander::Specifics
|
|
55
55
|
specified_hosts
|
56
56
|
end
|
57
57
|
end
|
58
|
+
|
59
|
+
def sort_primary_role_hosts_first!(hosts)
|
60
|
+
stable_sort!(hosts) { |host| roles_on(host).any? { |role| role == primary_role } ? 0 : 1 }
|
61
|
+
end
|
58
62
|
end
|
@@ -10,11 +10,6 @@
|
|
10
10
|
# They are application-specific, so they are not shared when multiple applications
|
11
11
|
# run on the same proxy.
|
12
12
|
#
|
13
|
-
# The proxy is enabled by default on the primary role but can be disabled by
|
14
|
-
# setting `proxy: false`.
|
15
|
-
#
|
16
|
-
# It is disabled by default on all other roles but can be enabled by setting
|
17
|
-
# `proxy: true` or providing a proxy configuration.
|
18
13
|
proxy:
|
19
14
|
|
20
15
|
# Hosts
|
@@ -113,3 +108,30 @@ proxy:
|
|
113
108
|
response_headers:
|
114
109
|
- X-Request-ID
|
115
110
|
- X-Request-Start
|
111
|
+
|
112
|
+
# Enabling/disabling the proxy on roles
|
113
|
+
#
|
114
|
+
# The proxy is enabled by default on the primary role but can be disabled by
|
115
|
+
# setting `proxy: false` in the primary role's configuration.
|
116
|
+
#
|
117
|
+
# ```yaml
|
118
|
+
# servers:
|
119
|
+
# web:
|
120
|
+
# hosts:
|
121
|
+
# - ...
|
122
|
+
# proxy: false
|
123
|
+
# ```
|
124
|
+
#
|
125
|
+
# It is disabled by default on all other roles but can be enabled by setting
|
126
|
+
# `proxy: true` or providing a proxy configuration for that role.
|
127
|
+
#
|
128
|
+
# ```yaml
|
129
|
+
# servers:
|
130
|
+
# web:
|
131
|
+
# hosts:
|
132
|
+
# - ...
|
133
|
+
# web2:
|
134
|
+
# hosts:
|
135
|
+
# - ...
|
136
|
+
# proxy: true
|
137
|
+
# ```
|
@@ -11,6 +11,7 @@ class Kamal::Configuration::Proxy
|
|
11
11
|
def initialize(config:, proxy_config:, context: "proxy")
|
12
12
|
@config = config
|
13
13
|
@proxy_config = proxy_config
|
14
|
+
@proxy_config = {} if @proxy_config.nil?
|
14
15
|
validate! @proxy_config, with: Kamal::Configuration::Validator::Proxy, context: context
|
15
16
|
end
|
16
17
|
|
data/lib/kamal/configuration.rb
CHANGED
@@ -63,7 +63,7 @@ class Kamal::Configuration
|
|
63
63
|
@env = Env.new(config: @raw_config.env || {}, secrets: secrets)
|
64
64
|
|
65
65
|
@logging = Logging.new(logging_config: @raw_config.logging)
|
66
|
-
@proxy = Proxy.new(config: self, proxy_config: @raw_config.
|
66
|
+
@proxy = Proxy.new(config: self, proxy_config: @raw_config.proxy)
|
67
67
|
@proxy_boot = Proxy::Boot.new(config: self)
|
68
68
|
@ssh = Ssh.new(config: self)
|
69
69
|
@sshkit = Sshkit.new(config: self)
|
data/lib/kamal/version.rb
CHANGED