The TeamcityRestConnector is a F# library designed to interact with the TeamCity REST API. It provides a comprehensive set of functionalities to manage and retrieve information from TeamCity, including projects, builds, users, VCS roots, agents, and more.
- Retrieve and manage TeamCity projects, builds, users, VCS roots, and agents.
- Trigger and cancel builds.
- Download build artifacts.
- Mute and unmute tests.
- Retrieve build logs and pending changes.
- Authenticate with TeamCity.
- .NET Standard 2.0 or .NET Framework 4.7.2
- F# Compiler
- RestSharp library
To use the TeamcityRestConnector in your project, you need to add the necessary dependencies. Ensure you have the following packages installed:
- RestSharp
You can install RestSharp via NuGet:
dotnet add package RestSharp
To use the TeamcityRestConnector, you need to create an instance of the TeamcityConnector class by providing an implementation of the IHttpTeamcityConnector interface.
open TeamcityRestConnector let httpConnector = // Your implementation of IHttpTeamcityConnector let teamcityConnector = TeamcityConnector(httpConnector)
let buildConfigId = "YourBuildConfigId" let branch = "YourBranchName" let comment = "Triggering build via API" let parameters = System.Collections.Generic.Dictionary<string, string>() parameters.Add("param1", "value1") let webUrl, href = teamcityConnector.TriggerTeamcityBuild(config, buildConfigId, branch, comment, parameters) printfn "Build triggered. Web URL: %s, Href: %s" webUrl href
let build = // Your TcBuild instance let artifactPath = "path/to/artifact" let outputFilePath = "path/to/output/file" let useDisk = true teamcityConnector.DownloadArtifact(config, build, artifactPath, outputFilePath, useDisk)
Contributions are welcome! Please feel free to submit a pull request or open an issue to discuss any changes or improvements.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or inquiries, please contact the project maintainers.