Skip to content

Conversation

@tortuetorche
Copy link

@tortuetorche tortuetorche commented Nov 24, 2025

Hi,

This pull request update Kamal::Configuration so every deploy YAML (including destination-specific files like deploy.staging.yml) is rendered via ERB.new(..., trim_mode: "-"). Templates can now safely use -%> without leaving stray blank lines in the parsed config.

Example snippets:

# deploy.yml.erb
service: app
servers:
  - <%= ENV['MAIN_IP'] %>
<% if ENV['EXTRA_IP'].presence -%>
  - <%= ENV['EXTRA_IP'] %>
<% end -%>
# Without trim_mode: "-" (old behavior)
servers:
  - 1.1.1.1

  - 1.1.1.2

# With trim mode (new behavior)
servers:
  - 1.1.1.1
  - 1.1.1.2

Thank you for open-sourcing this project! 🫶

Have a good day,
Tortue Torche

@tortuetorche tortuetorche marked this pull request as ready for review November 24, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant