https://github.com/octopusdeploy/teamcitycloudagentupdater
| Public | Simple NodeJS app to update AMI's for TeamCity Cloud Agents
https://github.com/octopusdeploy/teamcitycloudagentupdater
public
Last synced: about 1 month ago
JSON representation
| Public | Simple NodeJS app to update AMI's for TeamCity Cloud Agents
- Host: GitHub
- URL: https://github.com/octopusdeploy/teamcitycloudagentupdater
- Owner: OctopusDeploy
- License: other
- Created: 2016-09-20T20:36:17.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2026-02-02T17:08:08.000Z (2 months ago)
- Last Synced: 2026-02-03T07:33:41.089Z (2 months ago)
- Topics: public
- Language: JavaScript
- Size: 297 KB
- Stars: 0
- Watchers: 12
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# TeamCityCloudAgentUpdater
When a new TeamCity agent image is built (e.g., via [packer](packer.io)), you need to tell TeamCity to start using it.
This is a simple NodeJS app that can:
1. Update TeamCity Cloud Agents images and disable any agents that are running that are based on the old image
2. Remove any agents that were disabled during update that are no longer running a build
## Usage
When you have a new agent, update the cloud profile:
```bash
node index.js update-cloud-profile --token XXXXX --server https://teamcity.example.com --image ami-XXXXXXX --cloudprofile "AWS Agents" --agentprefix "Ubuntu" [--dryrun]
```
To remove any agents that were disabled as part of the update, and are no longer running a build (run on a schedule):
```bash
node index.js remove-disabled-agents --token XXXXX --server https://teamcity.example.com [--dryrun]
```
The `--dryrun` flag allows you to check what actions the script would have taken without any real modifications.
## Requirements
- Node.js >= 22.0.0
- npm >= 11.0.0
- TeamCity `2019.1` or newer (for user access tokens)
## Development
### Installation
```bash
npm install
```
### Testing
```bash
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
```
### Project Structure
```
.
├── index.js # Entry point
├── cli.js # CLI command definitions
├── lib/
│ ├── agents.js # Agent management operations
│ ├── cloud-profiles.js # Cloud profile management
│ └── utils.js # Utility functions
└── *.test.js # Test files co-located with source
```
## License
This project is licensed under the Apache 2.0 license.