TeamCity CommandLine - passing arguments

Hiya,

I can run the following MSDeploy command from the command line without problems.

trafalgar.png
However I can't seem to get the exact same command running in teamcity using the CommandLine build runner - the arguments are not recognized in the same way, something to do with the quotes I think?

argument.png

This is how I've set it up:

commandline.png

The full "command parameters" value is:
-source:package=C:\Builds\Packages\2.5.13.4663\Trafalgar.zip  -dest:auto,includeAcls=False -verb:sync -setParam:"IIS Web Application  Name"="dev.trafalgar.com"

Is there any trick I should know about to be able to get arguments/paramters working in the TeamCity CommandLine build runner?

Update: In the screenshots I don't have a double quote in front of dev.trafalgar.com in either the command line or the build task, but putting one there makes no difference to the outcome, so this is not the error.

Thanks!
Mark.

0
4 comments

Hi Mark

We filled this issue in TW-11848. As workaround you can change Run option to custom script and specify the command and all the arguments in a single string.

Michael

0

Michael,

Thanks so much for getting back - I didn't think to try the custom script option but it works brilliantly, thanks! A good enough workaround for now.

Regards,
Mark.

0

I have almost similar problem...

is there a way to pass ALL build params to the command line script rather than specify them one by one?
thanks

/usr/bin/phing -f build_scripts/tc_init_db_full.xml \
-DbuildDir=%teamcity.build.workingDir% \
-DtestDbHost=%system.testDBHost% \
-DtestDbPort=%system.testDBPort% \
-DtestDbUser=%system.testDBUser% \
-DtestDbPass=%system.testDBPass% \
-DtestDbName=%system.testDBName%
0

You can delcare them as environment variables instead of system properties.

0

Please sign in to leave a comment.