kamal
kamal copied to clipboard
Feature pitch: Support defining of custom CLI commands through deploy.yml
Hey, hi! I think it'd be handy to be able to define aliases in my config file to clean up repetitive commands I might want used across my team. For example allowing me to run kamal app console
to get to my Rails console with the following config.
alias:
app:
console: app exec -i "bin/rails c --sandbox"
angry_console: app exec -i "bin/rails c"
We might not want to pollute the cli with custom commands using names that might conflict with future features, so maybe it's all under kamal alias
or kamal run
or whatever.
If y'all are interested I'd be happy to knock together a PR for it.
As a workaround, consider incorporating a Makefile
into your project. This file can house the custom commands that you and your team frequently utilize.
example
logs.web:
kamal app logs -f -r web -d production
logs.job:
kamal app logs -f -r job -d production
prod.recalculate:
kamal app exec -d production -i --reuse 'bundle exec rake ranks:recalculate'
prod.console:
kamal app exec -d production -i --reuse './bin/rails c'
In Rails project, we're just defining custom command in bin/some-name-of-the-command
.
Maybe that would be enough for your needs @dhnaranjo
See https://github.com/basecamp/kamal/pull/912. Thanks for the great idea @dhnaranjo!
Thanks for doing the actual thing, @djmb.