Fetching what changed from build script

Hi,

Is there a way to fetch what files changed at the build runner level on the agent?  For example say I have a script that runs and when that build runs the script should be able to know what files triggered it?  Do I need to set something for this information to be exposed down at the build level.  I'd rather not have to use the rest api for this but if that is the only option then I'm fine with it but thought there would be an easier way to fetcht this information?

Thanks,
Jay

4 comments
Comment actions Permalink

Jason,

You might find teamcity.build.changedFiles.file parameter useful.

0
Comment actions Permalink

Thanks Yegor,

I'll take a look at this parameter.  If I'm using a Rakefile can I pass this parameter to it in the build step?  If not, does rake have access to these parameters?

Thanks,
Jay

0
Comment actions Permalink

As usual, you can add environment variable env.myVar=%teamcity.build.changedFiles.file% and then read the environment variable in your build script.

0
Comment actions Permalink

Thanks, that should work for us.

0

Please sign in to leave a comment.