mbtproject / mbt

The most flexible build tool for monorepo
https://github.com/mbtproject
Apache License 2.0
219 stars 35 forks source link

Template function for iterating modules in correct build order #132

Closed dustyhorizon closed 4 years ago

dustyhorizon commented 4 years ago

I am looking to use the mbt apply function with CI services like Jenkins X and TektonCD but I am unable to render the template in the correct build order (right now it is sorted by name).

Is there a workaround or a feature in the future where I could iterate the list of modules by build order so I can form the pipeline correctly?

Thanks!

buddhike commented 4 years ago

🤔 I thought it already did. Interesting. If it’s not doing that already we should make it do so. Off the top, I don’t think it would break the compatibility.

buddhike commented 4 years ago

@dustyhorizon soz, you are right. https://github.com/mbtproject/mbt/blob/master/lib/apply.go#L294

I can't recall why this list is sorted by name. I will add a new property that preserves the dependency order and get a new release.

buddhike commented 4 years ago

@dustyhorizon I managed to land this on master (https://github.com/mbtproject/mbt/pull/133). Could you please try the latest dev build and let me know if it's good enough 😉? Thanks a lot!

dustyhorizon commented 4 years ago

Sure thing! Let me get back to you within these few days

dustyhorizon commented 4 years ago

@buddyspike looks good so far, although during my test I came into a use case where mbt apply diff would be great so that I can generate an appropriate list of things to build for CIs that do not support some form of dependencies reference etc. but that is something I can workaround right now.

Meanwhile I'll go ahead and close this issue first. Thanks for quick fix though!