kamal icon indicating copy to clipboard operation
kamal copied to clipboard

Customize init command with optional arguments

Open hschne opened this issue 1 year ago • 5 comments

When running kamal init a deploy.yml file with hard-coded values for repository, user, etc. is created. Users have to modify this file to suit their needs manually.

service: my-app # <<<

image: user/my-app # <<<

servers:
  - 192.168.0.1 # <<<

registry:
  username: my-user # <<<

Proposition

These hard-coded values could either be inferred from the environment (e.g. username, directory...) or at least be customizable in the kamal init command. For example:

kamal init --service app-name --user user-name --server 192.168.0.1

I'd be happy to work on this. What do you think?

hschne avatar Jan 23 '24 10:01 hschne

I like that kamal init creates a .yml file for me to manually modify to my needs, not every kamal deployment is the same, so having kamal make assumptions about my configuration would only cost me more time.

acidtib avatar Jan 26 '24 20:01 acidtib

@acidtib I appreciate that! Just to clarify, I'm not advocating for replacing the deploy.yml, I'm merely proposing changing the default values with which it is created or making those default values configurable.

You'd still be able to modify those defaults - as you are now.

hschne avatar Jan 27 '24 17:01 hschne

I suggest implementing a post-init banner that provides information about what should be changed in deploy.yml.

igor-alexandrov avatar Mar 22 '24 10:03 igor-alexandrov

If I may add, another flag to remove the comments as well would be a nice to have.

Xavier-IV avatar Oct 11 '24 12:10 Xavier-IV

I like this. Would make it easier to parameterize if you're doing the same setup multiple times. Don't want to accept too much complexity for it, but if there's a simple shot to do this, I'm 👍

dhh avatar Oct 11 '24 18:10 dhh