-
-
Notifications
You must be signed in to change notification settings - Fork 194
Allow CLI environment to be optional / add default environment #38
Comments
@timkelty I am not OK with the magic that choose the environment from the current branch, I think it can be dangerous. I don't see the gain of not passing the environment in the CLI, you specify explicitly where you want to deploy, each time. Also it's difficult to make it optional because it's the first arguments and others are tasks. About branches, it's already possible to specify a custom branch by environment in the config. If no branch is setted (null or undefined) I am OK to trigger an inquirer to choice the branch to deploy (it's relative to shipit-deploy). |
@neoziro I'm not proposing the branch to environment magic would actually be part of Shipit. Just that you'd be able to specify a default environment in your config, like you can with branches. That would allow someone to pass their own method to that config property to do any magic they wished. But I get that it is difficult because of the arguments - hence there not being a PR :) |
Perhaps a consideration for 2.0 could be to pass the environment as an option flag and the other args are the tasks? e.g. |
@timkelty I prefer to keep the environment as a requirement, I don't see the benefit of having a default environment. |
Ok, sounds good. |
@neoziro The benefit is that with a sane default (e.g. Maybe we can re-evaluate this for v2.0.0? /cc @timkelty's |
@halfdan I am not for a default environment, I think is more explicit to do |
Anyone interested in this type of functionality, see https://github.com/timkelty/shipit-captain /cc @halfdan |
Making this issue here to brainstorm the best way to handle this.
Here's what I'm currently thinking:
shipit.initConfig
.master
→production
,development
→development
). The user could set the environment inshipit.initConfig
to a function that parsed your current git branch and returned the matching environement. Of course, they could always override it by passing an environment in the CLIshipit.initConfig
, trigger an inquirerchoices
prompt.The text was updated successfully, but these errors were encountered: