curl is not recognized as an internal or external command running from the Teamcity command line script

curl, teamcity

Solution

Expanding on the other answers, you do need to tell TeamCity where curl is.

But, you can do this through TeamCity by appending the path to curl to your env.Path variable, and the nice thing about this is you do not have to change the `PATH` variable on every build agent.

- In your build configuration, add `env.Path` under the "Build Parameters" section.

For the value, you need to specify the path to curl plus keep the existing values; something like:

`c:\path\to\dirWithCurl;%env.Path%`

Add a test build step if you like to prove that it worked; simply do the following and view the results:

`echo %env.Path%` `curl --help`

I explored how TeamCity handles appending values to this recently... see this answer for way too much information and an example with MySql. Look at edit #2, but the basics you need are above.

Problem

curl is not recognized as an internal or external command while running the Teamcity command line script. Curl is installed in local and works fine in command prompt. Build log Result : ``` [20:05:35]Step 2/2: Command Line [20:05:35][Step 2/2] Starting: C:\BuildAgent\temp\agentTmp\custom_script7047202395618427524.cmd [20:05:35][Step 2/2] in directory: C:\BuildAgent\work\376652cbd18bb804 [20:05:35][Step 2/2] 'curl' is not recognized as an internal or external command, [20:05:35][Step 2/2] operable program or batch file. [20:05:35][Step 2/2] Process exited with code 1 [20:05:35][Step 2/2] Step Command Line failed ``` curl command ``` curl -v --request PUT %teamcity.serverUrl%/httpAuth/app/rest/builds/id:%teamcity.build.id%/pin -u admin:admin ```

Original source

Related problems