diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4fa1e801..839bc4e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: - "3.1" - "3.2" - "3.3" + - "3.4.0-preview2" gemfile: - Gemfile - gemfiles/rails_edge.gemfile @@ -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: @@ -49,3 +53,5 @@ jobs: - name: Run tests run: bin/test + env: + RUBYOPT: ${{ startsWith(matrix.ruby-version, '3.4.') && '--enable=frozen-string-literal' || '' }} diff --git a/lib/kamal/commands/base.rb b/lib/kamal/commands/base.rb index 7521780ad..c0eac91cc 100644 --- a/lib/kamal/commands/base.rb +++ b/lib/kamal/commands/base.rb @@ -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) @@ -92,5 +85,14 @@ def grep(*args) def tags(**details) Kamal::Tags.from_config(config, **details) end + + def ssh_proxy_args + case config.ssh.proxy + when Net::SSH::Proxy::Jump + " -J #{config.ssh.proxy.jump_proxies}" + when Net::SSH::Proxy::Command + " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'" + end + end end end