Allow running a task before building an image similar to the devenv:enterShell
I want to achieve a result similar to what is documented in the Running artifacts, except that makes use of processes.*.exec which also runs when I do devenv up. I would rather not have a production binary being built every time I make a change in my development cycle, I am utilizing air to live build and reload my project during development. It seems the tasks system would be perfect for my use case of kicking off a production build when I do a devenv container build or devenv container run, but I cannot find any documentation saying if there is an appropriate hook for this.
You should be able to define the same logic in a let .. in ... and then pass it to processes.*.exec and tasks. Would that work?
I'm not too sure I follow, I'm still pretty new to nix and devenv so please bare with me...
I want to leave my processes definition as is as I have the following
processes = {
air.exec = "air";
yarn.exec = "yarn dev";
};
With this, when I make a change to my code air will handle live reloading my binary, but when I am building a container (presumably to use on a staging/prod environment) I would want to be able to statically compile my binary. Currently, I am doing this external of my devenv config with a makefile, but if possible, I would like to automate this and save myself a step when deploying if possible.
Like this? https://devenv.sh/common-patterns/#container-patterns