I talked with @reset about this in Slack, but figured I should open an issue for discussion. In short, I would like a way to specify a package or series of packages to install in my local studio by default. A good example is `curl.
I can currently install curl by running:
$ hab pkg install core/curl --binlink
$ export PATH="$PATH:/bin"
The challenge is that I have to run this command each time I create a new studio. For 95% of my use, I just want curl there so I can try to access my service inside the studio - super useful for local development.
I would like to propose a STUDIO_PKGS envvar and configuration option which installs those packages by default when creating a new studio. Additionally, there should probably be an option to _not_ do that, as a flag the user can pass for a particular studio (for the 5%) use case.
Alternatively, some kind of "dev deps" might also solve this, so I can just depend on curl in each app as a dev dependency.
So if you put those commands in your .studiorc in the directory in which you enter the studio they get executed any time you enter a new studio. #2308 points out some current problems with it, but that sounds like it does what you want (at least as I understand it and when I try it.) Am I missing anything?
we're probably missing documentation :)
What we do have is on this page: https://www.habitat.sh/docs/reference/environment-vars/#customizing-studio
This file can be used to export any environment variables like the ones you see above as well as any other shell customizations to help you develop your plans from within the studio.
That doesn't really convey "you can run arbitrary commands" to me.
I also want something global, like ~/.habitat/.studiorc, which would apply to all studios.
:+1:
There are some potentially gnarly implementation details around this, but I think the feature is 100% a sound concept. Going to throw this in help wanted for now, but I think it would be rad to get this into core!
If you want something like this today, a good workaround (or solution) is to put hab install chef/inspec core/redis ... into your .studiorc. This will install these packages when you enter the studio.
I like the solution proposed by @smith and really think this should be the default. So we'd only need documentation.
We have something just before https://www.habitat.sh/docs/reference/#plan-settings Maybe we can just add a phrase saying it can also be used to install packages.
For the global .studiorc this would be nice, and I think it would be nice to open another issue for that, what do you think?
If support for a global ~/.habitat/.studiorc file gets added, I'd love to be able to override that path via ENV or CLI arg for some studio automation work I have planned
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.
Most helpful comment
That doesn't really convey "you can run arbitrary commands" to me.
I also want something global, like
~/.habitat/.studiorc, which would apply to all studios.