Accessing Change List in Ant from TeamCity server
I would like to get the list of changed files from Teamcity in my Ant build. I am trying to do a build only if
at least one control file is present in the change list. How do I get the change list in Ant build from Teamcity?
Please sign in to leave a comment.
Hello Paul,
On agent there is a file which contains information about changed files, path to this file can be read from the system property "teamcity.build.changedFiles.file", read more here: http://confluence.jetbrains.net/display/TCD5/Predefined+Properties#PredefinedProperties-AgentBuildProperties.
Kind regards,
Marina
Thank you Marina I worked fine. I am able to access the Teamcity system properties from my Ant build script
eg in my build.xml I have the following:
<!-- Information on the Teamcity build server -->
<target name="info">
<echo message="==> Path to change file : ${teamcity.build.changedFiles.file}"/>
<echo message="==> Build Number : ${build.number}"/>
<echo message="==> Teamcity project Name : ${teamcity.projectName}"/>
<echo message="==> Agent Name : ${agent.name}"/>
</target>
And I am able to use the properties in my build.