serverUrl can be removed for EC2 integration plugins. Stop the agent (under Windows stop the service but leave it in Automatic startup type)ĭelete the content logs and temp directories in agent home (optional)ĭelete the /conf/amazon-* file (optional)Ĭhange config/buildAgent.properties to remove properties: name, serverUrl, authorizationToken (optional). Remove any temporary/history information in the system. Test the setup by rebooting the machine and checking that the agent connects normally to the server. Run the agent and check it is working OK and is compatible with all necessary build configurations, and so on.Ĭonfigure the system so that the agent is started on machine boot (and make sure TeamCity server is accessible on machine boot).įor Windows, see also Additional configuration for Windows agents Install any additional software necessary for the builds on the machine. It usually makes sense to specify tempDir and workDir in conf/buildAgent.properties to use the non-system drive ( d: under Windows). Recommended image (for example, Amazon AMI) preparation steps:Ĭhoose one of the existing generic images.Ĭonfigure server name and agent name in conf/buildAgent.properties - this is optional if the image will be started by TeamCity, but it is useful to test if the agent is configured correctly. If you need the connection between the server and the agent machine to be secure, you will need to set up the agent machine to establish a secure tunnel (for example, VPN) to the server on boot so that TeamCity agent receives data via the secure channel. Provided these requirements are met, usual TeamCity agent installation and cloud-provider image bundling procedures are applicable. The serverUrl, name, and authorizationToken properties can be empty or set to any value they are ignored when TeamCity starts the instance. TeamCity agent should start on machine startup.īuildAgent.properties can be left as is. TeamCity agent should be correctly installed. Here are the requirements for an image that can be used for TeamCity cloud integration: Preparing Image with Installed TeamCity Agent View information on example policies for Linux and Windows on the Amazon website. See the section below for permissions to set IAM roles on an agent instance. To use encrypted EBS volumes, the following additional permissions are required:Īn example of custom IAM policy definition (allows all EC2 operations from a specified IP address): To launch an instance with the IAM Role (applicable to instances cloned from AMIs and launch templates), the following additional permissions are required: To use spot fleets, the following additional permissions are required: To use spot instances, grant the following permissions in addition to those listed above: TeamCity requires the following permissions for Amazon EC2 Resources: Make sure the server URL specified on the Administration | Global Settings page is correct since agents will use it to connect to the server, if a custom server URL is not specified in the cloud profile settings. Note that the number of EC2 agents is limited by the total number of agent licenses you have in TeamCity. Preparing an Amazon EC2 image (AMI) with an installed TeamCity agentĬonfiguring EC2 integration on TeamCity server Understanding Amazon EC2 and ability to perform EC2 tasks is a prerequisite for configuring and using TeamCity Amazon EC2 integration. TeamCity supports Amazon EC2 spot instances and spot fleets. On the instance terminating/stopping, its disconnected agent is removed from the authorized agents list and is deleted from the system. If running timeout is configured on the cloud profile and it is reached, the instance is terminated (or stopped, if an existing Amazon instance has been selected as an image source). After that, the agent is processed as a regular agent. Once an agent is connected from a cloud instance started by TeamCity, it is automatically authorized (provided there are available agent licenses). TeamCity ensures that the running instances limit configured in the cloud profile is not exceeded. If there are no usual agents available, TeamCity finds a matching cloud image with a compatible agent and starts a new instance for the image. Once the agents are connected, TeamCity stores their parameters to be able to process the build configurations-to-agents compatibility correctly.įor each queued build, TeamCity first tries to start it on one of the regular, non-cloud agents. Once a cloud profile is configured in TeamCity with one or several images, TeamCity does a test start for all the new images to learn about the agents on them. It is assumed that the machine images are preconfigured to start TeamCity agent on boot (see details below). Integrations with other cloud solutions are available. TeamCity Amazon EC2 integration allows you to configure TeamCity with your Amazon account and then start and stop images with TeamCity agents on-demand based on the queued builds.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |