How to set the PATH environment variable in Jenkins configuration on Windows?

前端 未结 7 498
我在风中等你
我在风中等你 2020-11-30 13:35

When I run my build process on Windows Server 2008, it fails with the error message like

Cannot run program \"foo\": CreateProcess: error=2, The syste

相关标签:
7条回答
  • 2020-11-30 14:25

    I had a similar requirement to customize Path variable on a Windows slave with a Windows Jenkins master. I did not want to create a Jenkins global environment variable and wanted this variable to be specific to a particular windows node/agent.

    Here is what I did:

    1) Created an Environment Variable as shown below in Nodes -> WindowsNode -> Configure screen:

    2) Disconnected my Jenkins node.

    3) Restarted my Jenkins system process directly on the slave.

    4) Tested it out by clicking on Nodes -> WindowsNode -> System Information and saw the new environment variable assigned to the node:

    5) Then used it in a Jenkins job that would run on the Windows slave/agent by adding below command to an Execute Windows Batch Command build step:

    git --version

    0 讨论(0)
提交回复
热议问题