How to run script from plugin

Hi,

As far as I see you have a lot of build steps supports scripts like Powershell\CMD\etc. Do you have reusable API to use such functionality in new plugins?
For example I want to run PS script as part of my custom build step?

Thank you!

3 comments
Comment actions Permalink

Sorry for delay. Please have a look at our documentation for build runner plugins:
https://confluence.jetbrains.com/display/TCD9/Build+Runner+Plugin

Basically you need to provide own CommandLineBuildService and CommandLineBuildServiceFactory implementation where you simply return command line to start, and agent will do the rest.
Please also have a look at plugin examples mentioned on this page.

0
Comment actions Permalink

Thank you Pavel!

I want to have ability to specify additional script for specific Build step and I don't want to limit user script language and implements own script runner.
I hoped that TC has own abstraction layer on scripting like Windows Script that can be reused by plugin authors.

For example this approach can simply writing platform independent plugins and provide user ability to choice prefered script language.

0
Comment actions Permalink

Well, for now TeamCity does not provide features like this. You need to know path to interpreter of the script to be able to invoke it. Or, you can generate your own .sh or .cmd script which in turn can invoke another program.

0

Please sign in to leave a comment.