Cloud Agent Event Hooks


We're heavily using the brilliant EC2 cloud integration. We have a setup where we spawn an entire cloud based environment (database, two IIS web nodes, load balancer, etc) which automated tests run on, and it all works a treat.

The problem we have is speed. An entire environment setup takes around 20 minutes. In order to cut down the time, I'd like to start setting up an environment as soon as TeamCity spawns a new cloud agent, and to shut down the environment when the TeamCity cloud agent is shutdown after the defined inactivity period.

Is there a way to hook on to cloud agent events to attach scripts? If not, would this feature be considered?

Many thanks

Comment actions Permalink

As far as I know there is no easy way at the moment.I think it is possible to write a plugin which will do something like this, you can take as a reference this one:

If you need simpler way, I would recommend to submit feature request to our tracker.

Comment actions Permalink

Thanks for that Pavel, I think I'll submit a request to the tracker and in the meantime, I'll modify our agent image to send a single GET request, which will trigger a teamcity job. Not ideal as the images should be pure but it'll do for now.


Please sign in to leave a comment.