diff --git a/Gemfile.lock b/Gemfile.lock index d98fcb4f1..e055f6a49 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - kamal (2.0.0) + kamal (2.1.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) diff --git a/lib/kamal/cli/app.rb b/lib/kamal/cli/app.rb index 98a08f7d7..74b7b4df2 100644 --- a/lib/kamal/cli/app.rb +++ b/lib/kamal/cli/app.rb @@ -203,7 +203,7 @@ def logs run_locally do info "Following logs on #{KAMAL.primary_host}..." - KAMAL.specific_roles ||= [ "web" ] + KAMAL.specific_roles ||= [ KAMAL.primary_role.name ] role = KAMAL.roles_on(KAMAL.primary_host).first app = KAMAL.app(role: role, host: host) diff --git a/lib/kamal/configuration.rb b/lib/kamal/configuration.rb index fb997949d..6e8799bff 100644 --- a/lib/kamal/configuration.rb +++ b/lib/kamal/configuration.rb @@ -20,6 +20,8 @@ class Kamal::Configuration class << self def create_from(config_file:, destination: nil, version: nil) + ENV["KAMAL_DESTINATION"] = destination + raw_config = load_config_files(config_file, *destination_config_file(config_file, destination)) new raw_config, destination: destination, version: version diff --git a/lib/kamal/configuration/docs/ssh.yml b/lib/kamal/configuration/docs/ssh.yml index 14fce8f9f..8d1033521 100644 --- a/lib/kamal/configuration/docs/ssh.yml +++ b/lib/kamal/configuration/docs/ssh.yml @@ -61,3 +61,10 @@ ssh: # An array of strings, with each element of the array being # a raw private key in PEM format. key_data: [ "-----BEGIN OPENSSH PRIVATE KEY-----" ] + + # Config + # + # Set to true to load the default OpenSSH config files (~/.ssh/config, + # /etc/ssh_config), to false ignore config files, or to a file path + # (or array of paths) to load specific configuration. Defaults to true. + config: true diff --git a/lib/kamal/version.rb b/lib/kamal/version.rb index c43aab058..b69ff471b 100644 --- a/lib/kamal/version.rb +++ b/lib/kamal/version.rb @@ -1,3 +1,3 @@ module Kamal - VERSION = "2.0.0" + VERSION = "2.1.0" end diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 217091801..c1aaa6971 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -222,6 +222,13 @@ class ConfigurationTest < ActiveSupport::TestCase assert_equal "my-user", config.registry.username end + test "destination is loaded into env" do + dest_config_file = Pathname.new(File.expand_path("fixtures/deploy_for_dest.yml", __dir__)) + + config = Kamal::Configuration.create_from config_file: dest_config_file, destination: "world" + assert_equal ENV["KAMAL_DESTINATION"], "world" + end + test "destination yml config merge" do dest_config_file = Pathname.new(File.expand_path("fixtures/deploy_for_dest.yml", __dir__))