TeamCity VCS plugin for Diversion version control system.
This is a very rough, basic working version of a Diversion VCS plugin for TeamCity. It does give you first class VCS functionality in TeamCity for Diversion, rather than relying on PowerShell scripts, with change tracking, change details withing TeamCity, patches, server and agent side checkout.
The plugin does not use the Diversion API, it just wraps the dv CLI client so you will need that configured and logged in on your server and build agents.
Currently only tested on Windows on a single main branch.
✅ Working Features:
- ✅ Change Detection: Automatically detects new commits and triggers builds
- ✅ File-Level Changes: Shows actual changed files with status (added/modified/deleted)
- ✅ Server-Side Checkout: Build patches on TeamCity server (requires working directory)
- ✅ Agent-Side Checkout: Full support for
dvcommands on agents - ✅ Branch Monitoring: Track specific branches for changes
- ✅ Build Triggering: New commits automatically trigger configured builds
- ✅ Version Display: Shows commit numbers in TeamCity UI
⚠️ Single Branch Only: Each VCS root monitors one branch at a time
- TeamCity 2023.11 or later
- Java 8 or later
- Diversion CLI (
dv) installed for change detection
- Diversion CLI (
dv) installed and available in PATH - Diversion authentication configured (
dv loginmust be run) - Note: Required only if using agent-side checkout mode
- Download the plugin ZIP from the releases page or build from source
- Upload to TeamCity: Administration → Plugins → Upload plugin zip
- Restart TeamCity server
- Install Diversion CLI on TeamCity server (for change detection, required for both checkout modes)
- **Clone your Diversion workspace to your server **
- Configure your VCSRoot (select Diversion from the list, set your repo ID and working directory to the workspace you cloned in the previous step)
- Run
dv loginon server - For Agent-Side Checkout: Install Diversion CLI on all build agents and run
dv loginon each agent
mvn clean packageThe plugin ZIP will be created at: build/target/teamcity-diversion-vcs.zip
- Repository ID: Your Diversion repository ID (format:
dv.repo.<uuid>) - Branch Name: The branch to monitor (default:
main) - DV Executable Path: Path to
dvexecutable (default:dv) - Working Directory: Path to your diversion workspace on your server
dv repoThis will display your repository ID in the format dv.repo.<uuid>.
- TeamCity polls the Diversion repository for new commits
- Plugin uses
dv branchto get the latest commit on the monitored branch - Plugin uses
dv ls <commitId> <file>to get file-level changes with status codes - If new commits are detected, TeamCity triggers configured builds showing actual changed files
Both server-side and agent-side checkout are supported. Choose the mode that best fits your TeamCity configuration:
Server-Side Checkout:
- TeamCity server builds patches and sends them to agents
- Requires Working Directory to be configured in VCS root settings
- Server uses
dv checkoutto retrieve file contents for patch building - Agents receive patches and don't need Diversion CLI installed
- Best for environments where installing CLI on agents is impractical
Agent-Side Checkout:
- Agents perform checkout directly using Diversion CLI
- Agent runs
dv cloneon first checkout - Subsequent checkouts use
dv updateanddv checkoutfor fast incremental updates - Requires Diversion CLI installed and authenticated on all agents
- Best for distributed teams where agents have full CLI access
TCDiversion/
├── server/ Server-side plugin (change detection, patch building)
├── agent/ Agent-side plugin (workspace checkout)
├── build/ Plugin packaging
├── teamcity-plugin.xml Plugin descriptor
└── pom.xml Maven configuration
- Single branch monitoring: Each VCS root can only monitor one branch at a time
- No merge request integration: Does not integrate with Diversion code review features
- Build the plugin:
mvn clean package - Copy to TeamCity plugins directory:
copy build\target\teamcity-diversion-vcs.zip D:\TeamCityData\plugins\
- Restart TeamCity server
- Check logs:
D:\TeamCity\logs\teamcity-server.log
Contributions are welcome! Please ensure all changes include:
- Updated documentation
- Tested functionality
- Clean commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
For Diversion-specific questions, join the Diversion Discord.
For TeamCity plugin issues, please open a GitHub issue.