1
votes

I am fairly new to Teamcity. I have a project setup in Teamcity with more than 100 build configurations many of which are dependent on each other. I create a setup executable file for the project from all these build configurations.

Considering a scenario where there is an upgrade to the product and only few components are changed, I need only those changed components in the setup. I want to identify the builds triggered due to SVN commits and not via dependency triggers. I want to use artifacts from SVN build triggers only.

Is there a way where I can find the builds triggered via SVN commit and include only these builds in the setup to create executable?

2

2 Answers

1
votes

I found a way to figure out how the build is triggered. You can do this by using the parameter teamcity.build.triggeredBy. I have added following Command Line build step. The Following code will check if the build was triggered via SVN Commit.

IF "%teamcity.build.triggeredBy%" == "Subversion" (
    FOR %%I IN (%system.paths.artifacts%) DO COPY %%I %system.out.artifacts% /y
)

You will have to define the system.paths.artifacts as System Properties. Following are few examples.

  • "bin\Release\MyDLL.dll" "bin\Release\MYDLL.dll.config" "bin\Release\MYEXE.exe"
  • "C:\Output\MyDLL.dll" "C:\Output\MYDLL.dll.config"
  • "......\Output\MyDLL.dll" "......\Output\MYDLL.dll.config" "......\Output\MYEXE.exe"

Also define system.out.artifacts which is the destination directory where you want to copy the artifacts. Examples

  • "C:\Temp\Setup"
0
votes

If it is a one time search, you can go into the Audit page (Administration -> Audit) and figure out the builds triggerred by SVN commits and not dependency triggers.