tc

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tc is a minimal TeamCity REST API client for triggering builds and fetching build status and results.

Index

Constants

View Source
const TeamCityAPIVersion = "2026.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	ID     int
	Number int
	Branch string
	URL    string
	State  string
}

type Server

type Server struct {
	Server string

	User *string
	Pass *string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(server, token, username, password string) Server

func NewServerUsingBasicAuth

func NewServerUsingBasicAuth(server, username, password string) Server

func NewServerUsingTokenAuth

func NewServerUsingTokenAuth(server, token string) Server

func (Server) AddTags

func (s Server) AddTags(buildID int, tags []string) error

AddTags adds Tags to a TeamCity build run using the REST API

func (Server) BuildLog

func (s Server) BuildLog(buildID int) (statusCode int, body string, err error)

func (Server) BuildQueue

func (s Server) BuildQueue(buildID int) (statusCode int, body string, err error)

func (Server) BuildState

func (s Server) BuildState(buildID int) (statusCode int, body string, err error)

func (Server) CheckBuildLogStatus

func (s Server) CheckBuildLogStatus(statusCode, buildID int) error

func (Server) CheckFinishedBuild added in v1.3.0

func (s Server) CheckFinishedBuild(buildID int) error

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 (s Server) GetBuildsForPR(buildTypeID string, pr int, latest, wait bool, queueTimeout, runTimeout int) (*[]Build, error)

func (Server) RunBuild

func (s Server) RunBuild(buildTypeID, buildProperties, branch, testRegEx string, skipQueue bool) (buildID int, buildURL string, err error)

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?

func (Server) WaitForBuild

func (s Server) WaitForBuild(buildID, queueTimeout, runTimeout int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL