-
-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Summary
Currently when adding a new site to Trellis with Lima, if the new site is higher in the alphabet then Lima treats this as a new instance. This seems to be because Trellis CLI looks for the first name in the list of sites in development and this list is sorted alphabetically when it's created.
As a result, if you add a site beginning with 'a' to a Trellis setup that has sites beginning with 'b' or lower, you get a message:
VM does not exist for this project. Run
trellis vm startto create it.
and the CLI proceeds to create a new instance.
Two options:
- Change that approach,
- Allow setting the instance name, falling back to the existing method.
I'm advocating for the latter because
- having control gives people options in their use cases
- it doesn't break backwards compat. If people run into this in future, they'd be able to solve it by specifying the old instance name.
- I don't have a suggestion for the former (changing the approach).
This would probably be good as an option in trellis.cli.local.yml so that you don't always have to specify it in a flag.
Additional context
If for example you're using Trellis for multiple sites and you're naming your production servers, even if it's server1, server2 etc, it would make more sense to be able to refer to each instance by the server name rather than by whichever site is highest alphabetically on it. It would also help in instances where you have to have the instance name hardcoded, see Discourse for one example.