Modify %PATH% for later build steps (OD-2523)
Felix Hirt opened 5 months ago

I would like to add a step inside a job which modifies an environment variable (%PATH%) for all following steps in the same job.

If i do this inside the step where i need it, it works. But if i do it in a separate step (which i would like to reuse in other build jobs) it does not work. Makes sense, since i would assume every step runs in its own environment.

Could it be possible to somehow retain changes and reapply them to the environment for later steps? In github actions, individual actions can achieve this by modifying the "path", e.g: https://github.com/microsoft/setup-msbuild/blob/main/src/main.ts#L128

Or am i going about this all wrong, is there another way to achieve something like this already? I actually want to do exactly the same thing as in the example above, add the path to a specific version of msbuild for later build steps

  • Robin Shen commented 5 months ago

    This is not possible currently as each step in OneDev runs in a separate environment (separate docker container). To achieve this, some new mechanisms need to be introduced to make one step affecting another. I added an improvement request for this: OD-2525

  • Felix Hirt commented 5 months ago

    Thanks for the info, and for considering the feature for implementation. Should i close this issue as duplicate then?

  • Robin Shen commented 5 months ago

    Yes, I am closing this question now.

  • Robin Shen changed state to 'Closed' 5 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2523
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover