Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running a task before building an image similar to the devenv:enterShell #1731

Open
vendion opened this issue Feb 15, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@vendion
Copy link

vendion commented Feb 15, 2025

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.

@vendion vendion added the enhancement New feature or request label Feb 15, 2025
@domenkozar
Copy link
Member

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?

@vendion
Copy link
Author

vendion commented Feb 19, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants