-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Hi, great framework you guys have here, I almost built something similar before I found it.
As the title says, do you guys have any plans to support importing bootstrap.cfg files? At the moment it seems that if I package an application with a bootstrap.cfg file that has some services (which all depend on each other in some way) declared within it and then publish it. If i wanted to use all the services I'd have to re-declare the all of them in the current project's bootstrap.cfg. So you can imagine that if i had multiple groups of services packaged externally (and these service may have external dependencies themselves) this may become a bit tedious (or maybe I'm lazy :).
I've given it some thought and here's an ideal example of what a bootstrap.cfg file imports could look like:
trapper-demo.trapper-demo-web-service/hello-web-service
trapper-demo.trapper-demo-service/hello-service
puppetlabs.trapperkeeper.services.webserver.jetty9-service/jetty9-service
puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
# import section
[:import]
# specify namespace(package?) and optional bootstrap-config file name (default: bootstrap.cfg)
my.tottally-awesome-group-of-services:myboot.cfg
So in the bootstrap phase, the classpath for any namespaces (or package names?) specified in that section would be searched for the config file and they could be parsed recursively for their imports which are then merged and duplicates are removed.
From my initial walk through of the code it seems like only the parse-bootstrap-config! method would need to become a bit more sophisticated but I'm unsure of any other implications of changing it to support the above. (Shouldn't cause any performance issues since it only happens once)
I actually don't mind submitting a PR if this is something being considered. On the other hand, my alternative is to build a layer on top of trapperkeeper to support this for my own needs and just pass the options that trapperkeeper requires as seen in the wiki