Skip to content

Commit

Permalink
Merge branch 'basecamp:main' into buildpacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhammond authored Oct 2, 2024
2 parents dda8efe + 279bda2 commit 5482052
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/kamal/cli/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lib/kamal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions lib/kamal/configuration/docs/ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/kamal/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Kamal
VERSION = "2.0.0"
VERSION = "2.1.0"
end
7 changes: 7 additions & 0 deletions test/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down

0 comments on commit 5482052

Please sign in to comment.