kamal 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kamal/cli/app.rb +6 -2
- data/lib/kamal/cli/base.rb +7 -2
- data/lib/kamal/cli/main.rb +6 -3
- data/lib/kamal/commands/app.rb +1 -0
- data/lib/kamal/commands/docker.rb +1 -1
- data/lib/kamal/configuration.rb +0 -7
- data/lib/kamal/utils/sensitive.rb +1 -0
- data/lib/kamal/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2470f58e93ad7f181c9a422a0eef08c741190cb897c962b83aeda9effd4862f5
|
4
|
+
data.tar.gz: df8ddd4bf5dcf6687fab747bcfb11689dbe58b846ab6e392e99694ce8bfdff88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cef4c1ea22ffe3a0f80dbd2985cb3f3941e70dfcb35509a4ec7210124e517b0b7336ddd571370c32868d9d99442b9cc1186eb6a0cdefaa5db1b0475f117faae
|
7
|
+
data.tar.gz: 1f6d43624775bb9f1320692c3b4e5d061528b92763886f963cf184978e2405e478c5c6a55347316c69416f512bb5f70c970999d56e2e5c6937b6b83613338106
|
data/lib/kamal/cli/app.rb
CHANGED
@@ -147,8 +147,12 @@ class Kamal::Cli::App < Kamal::Cli::Base
|
|
147
147
|
using_version(version_or_latest) do |version|
|
148
148
|
say "Launching command with version #{version} from new container...", :magenta
|
149
149
|
on(KAMAL.hosts) do |host|
|
150
|
-
|
151
|
-
|
150
|
+
roles = KAMAL.roles_on(host)
|
151
|
+
|
152
|
+
roles.each do |role|
|
153
|
+
execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on app version #{version}"), verbosity: :debug
|
154
|
+
puts_by_host host, capture_with_info(*KAMAL.app(role: role).execute_in_new_container(cmd))
|
155
|
+
end
|
152
156
|
end
|
153
157
|
end
|
154
158
|
end
|
data/lib/kamal/cli/base.rb
CHANGED
@@ -24,6 +24,7 @@ module Kamal::Cli
|
|
24
24
|
|
25
25
|
def initialize(*)
|
26
26
|
super
|
27
|
+
@original_env = ENV.to_h.dup
|
27
28
|
load_envs
|
28
29
|
initialize_commander(options_with_subcommand_class_options)
|
29
30
|
end
|
@@ -37,6 +38,12 @@ module Kamal::Cli
|
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
41
|
+
def reload_envs
|
42
|
+
ENV.clear
|
43
|
+
ENV.update(@original_env)
|
44
|
+
load_envs
|
45
|
+
end
|
46
|
+
|
40
47
|
def options_with_subcommand_class_options
|
41
48
|
options.merge(@_initializer.last[:class_options] || {})
|
42
49
|
end
|
@@ -75,8 +82,6 @@ module Kamal::Cli
|
|
75
82
|
def mutating
|
76
83
|
return yield if KAMAL.holding_lock?
|
77
84
|
|
78
|
-
KAMAL.config.ensure_env_available
|
79
|
-
|
80
85
|
run_hook "pre-connect"
|
81
86
|
|
82
87
|
ensure_run_directory
|
data/lib/kamal/cli/main.rb
CHANGED
@@ -170,6 +170,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
|
|
170
170
|
end
|
171
171
|
|
172
172
|
desc "envify", "Create .env by evaluating .env.erb (or .env.staging.erb -> .env.staging when using -d staging)"
|
173
|
+
option :skip_push, aliases: "-P", type: :boolean, default: false, desc: "Skip .env file push"
|
173
174
|
def envify
|
174
175
|
if destination = options[:destination]
|
175
176
|
env_template_path = ".env.#{destination}.erb"
|
@@ -179,10 +180,12 @@ class Kamal::Cli::Main < Kamal::Cli::Base
|
|
179
180
|
env_path = ".env"
|
180
181
|
end
|
181
182
|
|
182
|
-
File.write(env_path, ERB.new(File.read(env_template_path)).result, perm: 0600)
|
183
|
+
File.write(env_path, ERB.new(File.read(env_template_path), trim_mode: "-").result, perm: 0600)
|
183
184
|
|
184
|
-
|
185
|
-
|
185
|
+
unless options[:skip_push]
|
186
|
+
reload_envs
|
187
|
+
invoke "kamal:cli:env:push", options
|
188
|
+
end
|
186
189
|
end
|
187
190
|
|
188
191
|
desc "remove", "Remove Traefik, app, accessories, and registry session from servers"
|
data/lib/kamal/commands/app.rb
CHANGED
@@ -18,6 +18,7 @@ class Kamal::Commands::App < Kamal::Commands::Base
|
|
18
18
|
"--name", container_name,
|
19
19
|
*(["--hostname", hostname] if hostname),
|
20
20
|
"-e", "KAMAL_CONTAINER_NAME=\"#{container_name}\"",
|
21
|
+
"-e", "KAMAL_VERSION=\"#{config.version}\"",
|
21
22
|
*role_config.env_args,
|
22
23
|
*role_config.health_check_args,
|
23
24
|
*config.logging_args,
|
@@ -16,6 +16,6 @@ class Kamal::Commands::Docker < Kamal::Commands::Base
|
|
16
16
|
|
17
17
|
# Do we have superuser access to install Docker and start system services?
|
18
18
|
def superuser?
|
19
|
-
[ '[ "${EUID:-$(id -u)}" -eq 0 ]' ]
|
19
|
+
[ '[ "${EUID:-$(id -u)}" -eq 0 ] || command -v sudo >/dev/null || command -v su >/dev/null' ]
|
20
20
|
end
|
21
21
|
end
|
data/lib/kamal/configuration.rb
CHANGED
@@ -204,13 +204,6 @@ class Kamal::Configuration
|
|
204
204
|
ensure_destination_if_required && ensure_required_keys_present && ensure_valid_kamal_version
|
205
205
|
end
|
206
206
|
|
207
|
-
# Will raise KeyError if any secret ENVs are missing
|
208
|
-
def ensure_env_available
|
209
|
-
roles.collect(&:env_file).each(&:to_s)
|
210
|
-
|
211
|
-
true
|
212
|
-
end
|
213
|
-
|
214
207
|
def to_h
|
215
208
|
{
|
216
209
|
roles: role_names,
|
data/lib/kamal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kamal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
270
|
- !ruby/object:Gem::Version
|
271
271
|
version: '0'
|
272
272
|
requirements: []
|
273
|
-
rubygems_version: 3.4.
|
273
|
+
rubygems_version: 3.4.21
|
274
274
|
signing_key:
|
275
275
|
specification_version: 4
|
276
276
|
summary: Deploy web apps in containers to servers running Docker with zero downtime.
|