jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
8.2k stars 192 forks source link

best practice(s) for re-using devbox scripts? #1926

Open justinTM opened 5 months ago

justinTM commented 5 months ago

What problem are you trying to solve?

I have a lot of projects with very similar devbox.json files. i'm wondering what ideas people have for keeping them synchronized?

my projects are a lot of AWS Lambdas based on python, deployed as docker images using terraform

i guess i'm wondering if Don't Repeat Yourself DRY principles are more important than have reproducible projects without a lot of dependencies (git submodules, gitlab pipeline imports, poetry python packages via git, etc.).

What solution would you like?

I would love a way to import and re-use devbox config between projects. not sure what it would look like, but maybe a git URL and branch to define common scripts and init hooks which can be overridden

Alternatives you've considered

Lagoja commented 4 months ago

Hey @justinTM

I think a good way to reuse scripts, packages, and other configuration is with Devbox Plugins.

As of Devbox 0.10, you can now define scripts and environment variables in a plugin that can be included in multiple projects. You can even host plugins remotely in Github, if you don't want to copy the plugin to all of your different projects.

Would this address the use cases you're describing?

svallory commented 2 weeks ago

@Lagoja I've been trying that approach with varying success. Here are some things I think can be improved: