Build steps for command line in TeamCity

In this topic, let us learn how to write build step using command line in TeamCity.

Command line runner can be used to run Windows as well as Linux commands. If build is running on windows machine, cmd.exe is used to execute your command. If build is running on Linux machine, bash shell is used to execute command.

Below image shows how we have configured command line runner to execute windows command. Please note that instead of running a single command, you can also run windows batch file or shell script as well.

Command line runner build step in TeamCity

Below image shows the sample build log for above build configuration. Note that it is creating the directory with name 5 (Build counter).

sample command line build log in TeamCity


You may also like...