Documentation
¶
Overview ¶
Package tc is a minimal TeamCity REST API client for triggering builds and fetching build status and results.
Index ¶
- Constants
- type Build
- type Server
- func (s Server) AddTags(buildID int, tags []string) error
- func (s Server) BuildLog(buildID int) (statusCode int, body string, err error)
- func (s Server) BuildQueue(buildID int) (statusCode int, body string, err error)
- func (s Server) BuildState(buildID int) (statusCode int, body string, err error)
- func (s Server) CheckBuildLogStatus(statusCode, buildID int) error
- func (s Server) CheckFinishedBuild(buildID int) error
- func (s Server) GetBuildsForPR(buildTypeID string, pr int, latest, wait bool, queueTimeout, runTimeout int) (*[]Build, error)
- func (s Server) RunBuild(buildTypeID, buildProperties, branch, testRegEx string, skipQueue bool) (buildID int, buildURL string, err error)
- func (s Server) TriggerBuild(buildTypeID, branch, testPattern, buildProperties string, skipQueue bool) (statusCode int, respBody string, err error)
- func (s Server) WaitForBuild(buildID, queueTimeout, runTimeout int) error
Constants ¶
const DefaultAPIVersion = "2026.1"
DefaultAPIVersion is the TeamCity REST API version used in request paths when Server.APIVersion is not set.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Server string
APIVersion string
User *string
Pass *string
// contains filtered or unexported fields
}
func NewServerUsingBasicAuth ¶
func NewServerUsingTokenAuth ¶
func (Server) BuildQueue ¶
func (Server) BuildState ¶
func (Server) CheckBuildLogStatus ¶
func (Server) CheckFinishedBuild ¶ added in v1.3.0
CheckFinishedBuild returns an error if a finished build was cancelled instead of run to completion, including TeamCity's cancellation reason when it provides one. Cancelled builds carry a canceledInfo element and status UNKNOWN, either of which is treated as cancellation.
func (Server) GetBuildsForPR ¶
func (Server) TriggerBuild ¶
func (s Server) TriggerBuild(buildTypeID, branch, testPattern, buildProperties string, skipQueue bool) (statusCode int, respBody string, err error)
TriggerBuild queues a TeamCity build for the given build type and branch with the test pattern and additional properties. todo is there any reason to not inline this into runbuild?