Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running .bat file from TeamCity

How can I automate executing a batch file from TeamCity. Can I create a TC build configuration and have the TC agent build that and automatically run the specified batch file?

EDIT: batch script.

echo off

echo Do you want to deploy xxxx to DerServ(yn): 
set /p input=

if "%input%" == "y" goto :1
if NOT "%input%" == "y" goto :2

:1
SET MSBUILD="C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
%MSBUILD% xxxxx.defaultTeamCity.msbuild /target:projBuild

goto end
 :2
ECHO Exiting...
goto end
 :end   

 pause

Error message:

[12:25:12]: 'projBuild' is not recognized as an internal or external command,[12:25:12]: operable program or batch file.[12:25:13]: Build finished

like image 316
ZVenue Avatar asked Sep 20 '11 18:09

ZVenue


1 Answers

Yes, you can do it using Command Line runner.

Build Step

like image 152
CrazyCoder Avatar answered Sep 22 '22 18:09

CrazyCoder