kamal 1.8.0 → 1.8.2
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/build.rb +1 -1
- data/lib/kamal/commands/builder/clone.rb +3 -2
- data/lib/kamal/configuration/docs/configuration.yml +12 -1
- data/lib/kamal/configuration/docs/env.yml +1 -1
- data/lib/kamal/configuration/validator/configuration.rb +6 -0
- data/lib/kamal/configuration/validator.rb +16 -3
- data/lib/kamal/configuration.rb +1 -1
- data/lib/kamal/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ae26abb4fc1400cdea434a6208bdbd1cfe91b3a11ba395205e38772ecc0256a
|
4
|
+
data.tar.gz: d1e1e6a9c89b5397b5c8049b99a39c66900e2f92cba464cdd8210fea9d2ca839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fd1140905bef700c2ffa580510b1cd85e4d1961deae2f11f838a27cba88169f1262e5e51a75d94fee431c12a19ab43d789706d366ecc944c5cfbf1e94f0a751
|
7
|
+
data.tar.gz: 460f1e3af9f7d5ff7d3f044b1e0941132eff81164d34c8ef97698893dcf2f48b8aa6b7b50ca4f713fef0816ecb7bd56ab5cdab8a220c6ae8a810ae8c50715b50
|
data/lib/kamal/cli/build.rb
CHANGED
@@ -140,7 +140,7 @@ class Kamal::Cli::Build < Kamal::Cli::Base
|
|
140
140
|
mirror_hosts = Concurrent::Hash.new
|
141
141
|
on(KAMAL.hosts) do |host|
|
142
142
|
first_mirror = capture_with_info(*KAMAL.builder.first_mirror).strip.presence
|
143
|
-
mirror_hosts[first_mirror] ||= host if first_mirror
|
143
|
+
mirror_hosts[first_mirror] ||= host.to_s if first_mirror
|
144
144
|
rescue SSHKit::Command::Failed => e
|
145
145
|
raise unless e.message =~ /error calling index: reflect: slice index out of range/
|
146
146
|
end
|
@@ -6,7 +6,7 @@ module Kamal::Commands::Builder::Clone
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def clone
|
9
|
-
git :clone, Kamal::Git.root, path: clone_directory
|
9
|
+
git :clone, Kamal::Git.root, "--recurse-submodules", path: clone_directory
|
10
10
|
end
|
11
11
|
|
12
12
|
def clone_reset_steps
|
@@ -14,7 +14,8 @@ module Kamal::Commands::Builder::Clone
|
|
14
14
|
git(:remote, "set-url", :origin, Kamal::Git.root, path: build_directory),
|
15
15
|
git(:fetch, :origin, path: build_directory),
|
16
16
|
git(:reset, "--hard", Kamal::Git.revision, path: build_directory),
|
17
|
-
git(:clean, "-fdx", path: build_directory)
|
17
|
+
git(:clean, "-fdx", path: build_directory),
|
18
|
+
git(:submodule, :update, "--init", path: build_directory)
|
18
19
|
]
|
19
20
|
end
|
20
21
|
|
@@ -2,13 +2,24 @@
|
|
2
2
|
#
|
3
3
|
# Configuration is read from the `config/deploy.yml`
|
4
4
|
#
|
5
|
+
|
6
|
+
# Destinations
|
7
|
+
#
|
5
8
|
# When running commands, you can specify a destination with the `-d` flag,
|
6
9
|
# e.g. `kamal deploy -d staging`
|
7
10
|
#
|
8
11
|
# In this case the configuration will also be read from `config/deploy.staging.yml`
|
9
12
|
# and merged with the base configuration.
|
13
|
+
|
14
|
+
# Extensions
|
15
|
+
#
|
16
|
+
# Kamal will not accept unrecognized keys in the configuration file.
|
17
|
+
#
|
18
|
+
# However, you might want to declare a configuration block using YAML anchors
|
19
|
+
# and aliases to avoid repetition.
|
10
20
|
#
|
11
|
-
#
|
21
|
+
# You can use prefix a configuration section with `x-` to indicate that it is an
|
22
|
+
# extension. Kamal will ignore the extension and not raise an error.
|
12
23
|
|
13
24
|
# The service name
|
14
25
|
# This is a required value. It is used as the container name prefix.
|
@@ -29,7 +29,7 @@ env:
|
|
29
29
|
# To pass the secrets you should list them under the `secret` key. When you do this the
|
30
30
|
# other variables need to be moved under the `clear` key.
|
31
31
|
#
|
32
|
-
# Unlike clear
|
32
|
+
# Unlike clear values, secrets are not passed directly to the container,
|
33
33
|
# but are stored in an env file on the host
|
34
34
|
# The file is not updated when deploying, only when running `kamal envify` or `kamal env push`.
|
35
35
|
env:
|
@@ -15,11 +15,10 @@ class Kamal::Configuration::Validator
|
|
15
15
|
def validate_against_example!(validation_config, example)
|
16
16
|
validate_type! validation_config, Hash
|
17
17
|
|
18
|
-
|
19
|
-
unknown_keys_error unknown_keys
|
20
|
-
end
|
18
|
+
check_unknown_keys! validation_config, example
|
21
19
|
|
22
20
|
validation_config.each do |key, value|
|
21
|
+
next if extension?(key)
|
23
22
|
with_context(key) do
|
24
23
|
example_value = example[key]
|
25
24
|
|
@@ -137,4 +136,18 @@ class Kamal::Configuration::Validator
|
|
137
136
|
ensure
|
138
137
|
@context = old_context
|
139
138
|
end
|
139
|
+
|
140
|
+
def allow_extensions?
|
141
|
+
false
|
142
|
+
end
|
143
|
+
|
144
|
+
def extension?(key)
|
145
|
+
key.to_s.start_with?("x-")
|
146
|
+
end
|
147
|
+
|
148
|
+
def check_unknown_keys!(config, example)
|
149
|
+
unknown_keys = config.keys - example.keys
|
150
|
+
unknown_keys.reject! { |key| extension?(key) } if allow_extensions?
|
151
|
+
unknown_keys_error unknown_keys if unknown_keys.present?
|
152
|
+
end
|
140
153
|
end
|
data/lib/kamal/configuration.rb
CHANGED
@@ -47,7 +47,7 @@ class Kamal::Configuration
|
|
47
47
|
@destination = destination
|
48
48
|
@declared_version = version
|
49
49
|
|
50
|
-
validate! raw_config, example: validation_yml.symbolize_keys, context: ""
|
50
|
+
validate! raw_config, example: validation_yml.symbolize_keys, context: "", with: Kamal::Configuration::Validator::Configuration
|
51
51
|
|
52
52
|
# Eager load config to validate it, these are first as they have dependencies later on
|
53
53
|
@servers = Servers.new(config: self)
|
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.8.
|
4
|
+
version: 1.8.2
|
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: 2024-
|
11
|
+
date: 2024-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -295,6 +295,7 @@ files:
|
|
295
295
|
- lib/kamal/configuration/validator.rb
|
296
296
|
- lib/kamal/configuration/validator/accessory.rb
|
297
297
|
- lib/kamal/configuration/validator/builder.rb
|
298
|
+
- lib/kamal/configuration/validator/configuration.rb
|
298
299
|
- lib/kamal/configuration/validator/env.rb
|
299
300
|
- lib/kamal/configuration/validator/registry.rb
|
300
301
|
- lib/kamal/configuration/validator/role.rb
|