kamal
kamal copied to clipboard
Customize init command with optional arguments
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?
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 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.
I suggest implementing a post-init banner that provides information about what should be changed in deploy.yml
.
If I may add, another flag to remove the comments as well would be a nice to have.
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 👍