4
votes

I have a TeamCity build agent installed on a machine which in theory is dedicated to running dynamic security scans and I don't want it doing anything else (i.e. running the duplicates finder).

Short of either creating custom agent configuration properties then customising each build's agent dependencies (which perhaps strictly speaking I should be doing anyway) or configuring the agent to only run selected configurations, is there any way to avoid this? Both of these approaches require additional configuration on a per-build basis either on every single build.

In a perfect world, I'd like to be able to tell the agent to only ever run builds which match a particular agent dependency. Is this possible or am I coming at it from the wrong direction?

2
what do you mean agent dependency? You should be able to set the compatible agents on teamcity to just have selected what configurations you want to run on that machine..I am not sure if I am following your question rightremo
I actually mean "agent requirement". For example, I can create a requirement called "App sec scan" in step 7 of the build config, I'd now like to be able to tell the agent on the server doing the scans to only ever run a build with this requirement.Troy Hunt
Useful docs (not an answer): confluence.jetbrains.com/display/TCD10/…Vadzim

2 Answers

3
votes

I'm afraid TeamCity doesn't provide a way to specify that agent can run only configurations with a specific property (and not run other configurations).

So, there are only two ways to specify agents: either with agent requirements, or with configuring the agent to only run selected configurations.

You could probably try to make some batch change in your build configuration properties, because all build configuration settings/properties are stored in XML files on disk.

3
votes

In current versions of TeamCity (e.g. 8.1) you can create a pool just for your security machine, and only assign the one machine to that pool, remembering to remove it from other pools.

Then you can assign the security project to that pool. That should solve your problem.