Sharing information across build agents

Answered

I'm trying to run a set of automated tests across a system which is half Windows and half Linux. I have two EC2 images, one for each operating system, and I have defined a cloud profile which starts an instance of each type when a build is kicked off (by entering two image ids in the 'Agent images to run' section) . My problem is that I need to configure each machine to talk to the other machine in the pair, which involves editing a config file on each machine to include the hostname of the other machine. I can see there's a parameter for the hostname of the current agent (%teamcity.agent.name%) but is there any way for TeamCity to share the information about both agents in the build configuration?

Thanks in advance

Chris

4 comments

Are both EC2 machines (i.e. Team City agents) part of the same job?

0

I would like them to be part of the same job, with some build steps running on the windows machine and some on the Linux machine, but I'm not sure that's possible. For the start, I'd probably just set up a chain of builds which do something like 'Install Windows Components' -> 'Install Linux Components' -> 'Run Tests'

But the install steps need the information from the other machine in order to set up the communication between the two.

0

I have come across similar situation where my testbed has multiple machines. I don't want to declare each instance as an agent as it will add to the cost and complexity.

My solution to your problem is:

  • Install a test agent (a simple flask app that is running as a process) on both Windows and Linux machines
  • Have your base machine (instance running Team City) take care of the orchestration/coordination. This machine will use the flask interface to kick off the build on Linux and Windows machine. Your base machine will need to have a timeout mechanism in case of a failure.

You can also use standard configuration management tools such as Ansible or Salt Stack or even Fabric (http://www.fabfile.org/) instead of Flask. Hope this helps.

0

Thanks for that, it sounds promising. I'll give it a go.

 

 

0

Please sign in to leave a comment.