Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to be able to run on 3.4 with frozen strings #1080

Merged
merged 7 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- "3.1"
- "3.2"
- "3.3"
- "3.4.0-preview2"
gemfile:
- Gemfile
- gemfiles/rails_edge.gemfile
Expand All @@ -41,6 +42,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Remove gemfile.lock
run: rm Gemfile.lock

- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -49,3 +53,5 @@ jobs:

- name: Run tests
run: bin/test
env:
RUBYOPT: ${{ matrix.ruby-version == '3.4.0-preview2' && '--enable=frozen-string-literal' || '' }}
jeremy marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 9 additions & 8 deletions lib/kamal/commands/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ def initialize(config)
end

def run_over_ssh(*command, host:)
"ssh".tap do |cmd|
if config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Jump)
cmd << " -J #{config.ssh.proxy.jump_proxies}"
elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command)
cmd << " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
end
cmd << " -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
end
"ssh #{ssh_proxy_args} -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
end

def container_id_for(container_name:, only_running: false)
Expand Down Expand Up @@ -92,5 +85,13 @@ def grep(*args)
def tags(**details)
Kamal::Tags.from_config(config, **details)
end

def ssh_proxy_args
if config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Jump)
"-J #{config.ssh.proxy.jump_proxies}"
jeremy marked this conversation as resolved.
Show resolved Hide resolved
elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command)
"-o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
jeremy marked this conversation as resolved.
Show resolved Hide resolved
end
end
jeremy marked this conversation as resolved.
Show resolved Hide resolved
end
end
Loading