2

Is it possible to call a command line program in teamcity and to pipe the output from the command line program to a file?

2 Answers 2

5

You might be looking for something similar to : http://confluence.jetbrains.com/display/TCD7/Command+Line option .

in 'Build Steps' - you can choose 'Command Line' as Runner Type and in Run select 'Custom script' & write the shell command line to execute in 'Custom script' text area.

echo "Hello there!!" | tee someFile.log

And add to artifact path if you want to...

1
  • On Windows I had to do echo "Hello there!!" > "tee someFile.log"
    – nawfal
    Jul 4, 2017 at 18:11
1

Yes of course - you can use a Powershell build step for this and pipe the console output to a file, here a practical example:

git rev-parse HEAD > GitRevision.txt

Note that this question/answer is really unrelated to TeamCity - this is just Powershell (you can achieve the same using command line)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.