teamcity

package
v0.0.0-...-3d0907c Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//StepExecuteModeDefault executes the step only if all previous steps finished successfully.
	StepExecuteModeDefault = "default"
	//StepExecuteModeOnlyIfBuildIsSuccessful executes the step only if the whole build is successful.
	StepExecuteModeOnlyIfBuildIsSuccessful = "execute_if_success"
	//StepExecuteModeEvenWhenFailed executes the step even if previous steps failed.
	StepExecuteModeEvenWhenFailed = "execute_if_failed"
	//StepExecuteAlways executes even if build stop command was issued.
	StepExecuteAlways = "execute_always"
)
View Source
const (
	//BuildTriggerVcs trigger type
	BuildTriggerVcs triggerType = "vcsTrigger"
	//BuildTriggerBuildFinish build trigger type
	BuildTriggerBuildFinish triggerType = "buildDependencyTrigger"
	//BuildTriggerSchedule build trigger tyope
	BuildTriggerSchedule triggerType = "schedulingTrigger"
)
View Source
const DefaultBuildConfigurationType = "REGULAR"

DefaultBuildConfigurationType is default build configuration type setting for build configurations. Other possible values for this setting would be "DEPLOYMENT" or "COMPOSITE"

View Source
const DefaultBuildNumberFormat = "%build.counter%"

DefaultBuildNumberFormat is TC's default build number format setting for build configurations

View Source
const DefaultCheckoutMode = "AUTO"

AUTO, MANUAL, ON_AGENT, ON_SERVER

View Source
const (
	//Git vcs type
	Git vcsName = "jetbrains.git"
)

Variables

View Source
var ConditionStrings = []string{
	"exists",
	"equals",
	"does-not-equal",
	"more-than",
	"no-more-than",
	"less-than",
	"no-less-than",
	"starts-with",
	"contains",
	"does-not-contain",
	"ends-with",
	"matches",
	"does-not-match",
	"ver-more-than",
	"ver-no-more-than",
	"ver-less-than",
	"ver-no-less-than",
}

ConditionStrings - All possible condition strings. Do not change the values.

View Source
var Conditions = struct {
	Exists            string
	Equals            string
	DoesNotEqual      string
	MoreThan          string
	NoMoreThan        string
	LessThan          string
	NoLessThan        string
	StartsWith        string
	Contains          string
	DoesNotContain    string
	EndsWith          string
	Matches           string
	DoesNotMatch      string
	VersionMoreThan   string
	VersionNoMoreThan string
	VersionLessThan   string
	VersionNoLessThan string
}{
	Exists:            ConditionStrings[0],
	Equals:            ConditionStrings[1],
	DoesNotEqual:      ConditionStrings[2],
	MoreThan:          ConditionStrings[3],
	NoMoreThan:        ConditionStrings[4],
	LessThan:          ConditionStrings[5],
	NoLessThan:        ConditionStrings[6],
	StartsWith:        ConditionStrings[7],
	Contains:          ConditionStrings[8],
	DoesNotContain:    ConditionStrings[9],
	EndsWith:          ConditionStrings[10],
	Matches:           ConditionStrings[11],
	DoesNotMatch:      ConditionStrings[12],
	VersionMoreThan:   ConditionStrings[13],
	VersionNoMoreThan: ConditionStrings[14],
	VersionLessThan:   ConditionStrings[15],
	VersionNoLessThan: ConditionStrings[16],
}

Conditions - Possible conditions for requirements. Do not change the values.

View Source
var DebugRequests = false

DebugRequests toggle to enable tracing requests to stdout

View Source
var DebugResponses = false

DebugResponses toggle to enable tracing responses to stdout

View Source
var DefaultSnapshotDependencyOptions = &SnapshotDependencyOptions{
	OnFailedDependency:                  "RUN_ADD_PROBLEM",
	OnFailedToStartOrCanceledDependency: "MAKE_FAILED_TO_START",
	RunSameAgent:                        false,
	TakeSuccessfulBuildsOnly:            true,
	DoNotRunNewBuildIfThereIsASuitable:  true,
}

DefaultSnapshotDependencyOptions are the same options presented by default on Teamcity UI. Do not change this.

View Source
var ParameterTypes = struct {
	Configuration       paramType
	System              paramType
	EnvironmentVariable paramType
}{
	Configuration:       configParamType,
	System:              systemParamType,
	EnvironmentVariable: envVarParamType,
}

ParameterTypes represent the possible parameter types

View Source
var TriggerTypes = struct {
	Vcs         triggerType
	BuildFinish triggerType
	Schedule    triggerType
}{
	Vcs:         BuildTriggerVcs,
	BuildFinish: BuildTriggerBuildFinish,
	Schedule:    BuildTriggerSchedule,
}

TriggerTypes represents possible types for build triggers

View Source
var VcsNames = struct {
	Git vcsName
}{
	Git: Git,
}

VcsNames represents possible vcsNames for VCS Roots

Functions

func NewBool

func NewBool(b bool) *bool

NewBool is a helper function to return a *bool to the specified value

func NewFalse

func NewFalse() *bool

NewFalse is a helper function to return a *bool to true

func NewInt32

func NewInt32(i int32) *int32

NewInt32 is a helper function to return a *int32 to the specified value

func NewTrue

func NewTrue() *bool

NewTrue is a helper function to return a *bool to true

Types

type AgentPool

type AgentPool struct {
	Href      string                       `json:"href,omitempty" xml:"href"`
	Id        int                          `json:"id,omitempty" xml:"id"`
	Name      string                       `json:"name,omitempty" xml:"name"`
	MaxAgents *int                         `json:"maxAgents,omitempty" xml:"maxAgents"`
	Projects  *AgentPoolProjectAssignments `json:"projects,omitempty" xml:"projects"`
}

AgentPool contains information about the Agent Pool

type AgentPoolProjectAssignments

type AgentPoolProjectAssignments struct {
	Project []ProjectReference `json:"project,omitempty" xml:"project"`
}

AgentPoolProjectAssignments is a wrapper containing the Projects attached to this Agent Pool

type AgentPoolReference

type AgentPoolReference struct {
	Href string `json:"href,omitempty" xml:"href"`
	Id   int    `json:"id,omitempty" xml:"id"`
	Name string `json:"name,omitempty" xml:"name"`
}

AgentPoolReference is a reference to an Agent Pool

type AgentPoolsService

type AgentPoolsService struct {
	// contains filtered or unexported fields
}

AgentPoolsService has operations for handling agent pools

func (*AgentPoolsService) AssignProject

func (s *AgentPoolsService) AssignProject(poolId int, projectId string) error

AssignProject assigns a Project to a Agent Pool

func (*AgentPoolsService) Create

func (s *AgentPoolsService) Create(pool CreateAgentPool) (*AgentPool, error)

Create will create an Agent Pool - which must have a unique name

func (*AgentPoolsService) Delete

func (s *AgentPoolsService) Delete(id int) error

Delete will delete an Agent Pool based on it's ID

func (*AgentPoolsService) GetByID

func (s *AgentPoolsService) GetByID(id int) (*AgentPool, error)

Get will return an Agent Pool based on it's ID

func (*AgentPoolsService) GetByName

func (s *AgentPoolsService) GetByName(name string) (*AgentPool, error)

Get will return an Agent Pool based on it's Name

func (*AgentPoolsService) List

func (s *AgentPoolsService) List() (*ListAgentPools, error)

List returns all of the available Agent Pools

func (*AgentPoolsService) ListForProject

func (s *AgentPoolsService) ListForProject(projectId string) (*ListAgentPools, error)

List returns all of the assigned Agent Pools for a specific Project

func (*AgentPoolsService) UnassignProject

func (s *AgentPoolsService) UnassignProject(poolId int, projectId string) error

UnassignProject unassigns a Project from a Agent Pool

type AgentRequirement

type AgentRequirement struct {
	// build type id
	BuildTypeID string `json:"-"`

	// id
	ID string `json:"id,omitempty" xml:"id"`

	// inherited
	Inherited *bool `json:"inherited,omitempty" xml:"inherited"`

	// inherited
	Disabled *bool `json:"disabled,omitempty" xml:"disabled"`

	// type
	Condition string `json:"type,omitempty"`

	// Do not use this directly, build this struct via NewAgentRequirement
	Properties *Properties `json:"properties,omitempty"`
}

AgentRequirement is a condition evaluated per agent to see if a build type is compatible or not

func NewAgentRequirement

func NewAgentRequirement(condition string, paramName string, paramValue string) (*AgentRequirement, error)

NewAgentRequirement creates AgentRequirement structure with correct representation. Use this instead of creating the struct manually.

func (*AgentRequirement) Name

func (a *AgentRequirement) Name() string

Name - Getter for "property-name" field of the requirement

func (*AgentRequirement) Value

func (a *AgentRequirement) Value() string

Value - Getter for "property-value" field of the requirement

type AgentRequirementService

type AgentRequirementService struct {
	BuildTypeID string
	// contains filtered or unexported fields
}

AgentRequirementService provides operations for managing agent requirements for a build type

func (*AgentRequirementService) Create

Create a new agent requirement for build type

func (*AgentRequirementService) Delete

func (s *AgentRequirementService) Delete(id string) error

Delete removes an agent requirement from the build configuration by its id

func (*AgentRequirementService) GetAll

GetAll returns all agent requirements for a given build configuration

func (*AgentRequirementService) GetByID

GetByID returns an agent requirement by its id

type ArtifactDependency

type ArtifactDependency struct {
	SourceBuildTypeID string

	Options *ArtifactDependencyOptions
	// contains filtered or unexported fields
}

ArtifactDependency represents a single artifact dependency for a build type

func NewArtifactDependency

func NewArtifactDependency(sourceBuildTypeID string, opt *ArtifactDependencyOptions) (*ArtifactDependency, error)

NewArtifactDependency creates a ArtifactDependency with specified options

func (*ArtifactDependency) BuildTypeID

func (s *ArtifactDependency) BuildTypeID() string

BuildTypeID gets the build type identifier

func (*ArtifactDependency) Disabled

func (s *ArtifactDependency) Disabled() bool

Disabled gets the disabled status for this dependency

func (*ArtifactDependency) ID

func (s *ArtifactDependency) ID() string

ID for this entity

func (*ArtifactDependency) MarshalJSON

func (s *ArtifactDependency) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for ArtifactDependency

func (*ArtifactDependency) SetBuildTypeID

func (s *ArtifactDependency) SetBuildTypeID(id string)

SetBuildTypeID sets the build type identifier

func (*ArtifactDependency) SetDisabled

func (s *ArtifactDependency) SetDisabled(disabled bool)

SetDisabled controls whether this dependency is disabled or not

func (*ArtifactDependency) Type

func (s *ArtifactDependency) Type() string

Type for this entity

func (*ArtifactDependency) UnmarshalJSON

func (s *ArtifactDependency) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for ArtifactDependency

type ArtifactDependencyOptions

type ArtifactDependencyOptions struct {
	//ArtifactRevisionType maps to the TeamCity UI's "Get artifacts from", indicating which build should be used as artifact source.
	ArtifactRevisionType ArtifactDependencyRevision `prop:"revisionName"`

	//PathRules is a list of rules to match files that will have to be dowloaded from the source build that output artifacts.
	PathRules []string `prop:"pathRules"`

	//CleanDestination
	CleanDestination bool `prop:"cleanDestinationDirectory"`

	//RevisionNumber is used in conjunction with `BuildWithSpecifiedNumber` (as the build number value) or `LastBuildFinishedWithTag` (as the tag value to look for)
	RevisionNumber string
}

ArtifactDependencyOptions represents options when creating an artifact dependency for a build configuration. For more information see: https://confluence.jetbrains.com/display/TCD10/Artifact+Dependencies

func NewArtifactDependencyOptions

func NewArtifactDependencyOptions(pathRules []string, revisionType ArtifactDependencyRevision, cleanDestination bool, revisionValue string) (*ArtifactDependencyOptions, error)

NewArtifactDependencyOptions creates an instance of ArtifactDependencyOptions with default values.

(required) pathRules - list of rules to match files that will have to be dowloaded from the source build that output artifacts. They can be specified in the format [+:|-:]SourcePath[!ArchivePath][=>DestinationPath]

(required) revisionType - Which kind of revision type the artifact dependency will be based upon. See ArtifactDependencyRevision enum for options.

(optional) revisionValue - Required if using `BuildWithSpecifiedNumber` or `LastBuildFinishedWithTag`

type ArtifactDependencyRevision

type ArtifactDependencyRevision string

ArtifactDependencyRevision has some allowed values listed per constants.

const (
	// LatestSuccessfulBuild grabs the artifacts produced by the last sucessful build for the source build configuration.
	LatestSuccessfulBuild ArtifactDependencyRevision = "lastSuccessful"

	// LatestPinnedBuild grabs the artifacts produced by the last pinned build for the source build configuration.
	LatestPinnedBuild ArtifactDependencyRevision = "lastPinned"

	// LatestFinishedBuild grabs the artifacts produced by the last finished build, sucessful or not, for the source build configuration.
	LatestFinishedBuild ArtifactDependencyRevision = "lastFinished"

	// BuildFromSameChain grabs the artifacts produced by the source build triggered within the same build chain.
	BuildFromSameChain ArtifactDependencyRevision = "sameChainOrLastFinished"

	// BuildWithSpecifiedNumber grabs the artifacts produced by the source build that has a specific build number.
	BuildWithSpecifiedNumber ArtifactDependencyRevision = "buildNumber"

	// LastBuildFinishedWithTag grabs the artifacts produced by the source build that have a specific VCS tag
	LastBuildFinishedWithTag ArtifactDependencyRevision = "buildTag"
)

type Auth

type Auth interface{}

func BasicAuth

func BasicAuth(username, password string) Auth

func TokenAuth

func TokenAuth(token string) Auth

type BuildFeature

type BuildFeature interface {
	ID() string
	SetID(value string)
	Type() string
	Properties() *Properties
	BuildTypeID() string
	SetBuildTypeID(value string)
	Disabled() bool
	SetDisabled(value bool)
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
}

BuildFeature is an interface representing different types of build features that can be added to a build type.

type BuildFeatureService

type BuildFeatureService struct {
	BuildTypeID string
	// contains filtered or unexported fields
}

BuildFeatureService provides operations for managing build features for a buildType

func (*BuildFeatureService) Create

Create adds a new build feature to build type

func (*BuildFeatureService) Delete

func (s *BuildFeatureService) Delete(id string) error

Delete removes a build feature from the build configuration by its id.

func (*BuildFeatureService) GetByID

func (s *BuildFeatureService) GetByID(id string) (BuildFeature, error)

GetByID returns a build feature by its id

type BuildStepType

type BuildStepType = string

BuildStepType represents most common step types for build steps

const (
	//StepTypePowershell step type
	StepTypePowershell BuildStepType = "jetbrains_powershell"
	//StepTypeDotnetCli step type
	StepTypeDotnetCli BuildStepType = "dotnet.cli"
	//StepTypeCommandLine (shell/cmd) step type
	StepTypeCommandLine          BuildStepType = "simpleRunner"
	StepTypeOctopusPushPackage   BuildStepType = "octopus.push.package"
	StepTypeOctopusCreateRelease BuildStepType = "octopus.create.release"
)

type BuildTemplateService

type BuildTemplateService struct {
	BuildTypeID string
	// contains filtered or unexported fields
}

BuildTemplateService provides operations for managing attaching/detaching build configuration templates to/from build configurations

func NewBuildTemplateService

func NewBuildTemplateService(buildTypeID string, c *http.Client, base *sling.Sling) *BuildTemplateService

NewBuildTemplateService constructs an instance of NewBuildTemplateService scoped to a given buildTypeId

func (*BuildTemplateService) Attach

func (s *BuildTemplateService) Attach(buildTemplateID string) (*BuildTypeReference, error)

Attach is an idempotent operation that attaches the build template with given ID to the build configuration fo this service.

func (*BuildTemplateService) Detach

func (s *BuildTemplateService) Detach(buildTemplateID string) error

Detach disassociates the build template with given ID from the build configuration fo this service.

type BuildType

type BuildType struct {
	ProjectID   string
	ID          string
	Name        string
	Description string
	Options     *BuildTypeOptions
	Disabled    bool
	IsTemplate  bool
	Steps       []Step
	Templates   *Templates

	VcsRootEntries []*VcsRootEntry
	Parameters     *Parameters
	// contains filtered or unexported fields
}

BuildType represents a build configuration or a build configuration template

func NewBuildType

func NewBuildType(projectID string, name string) (*BuildType, error)

NewBuildType returns a build configuration with default options

func NewBuildTypeTemplate

func NewBuildTypeTemplate(projectID string, name string) (*BuildType, error)

NewBuildTypeTemplate returns a build configuration template with default options

func (*BuildType) MarshalJSON

func (b *BuildType) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for BuildType

func (*BuildType) Reference

func (b *BuildType) Reference() *BuildTypeReference

Reference converts a BuildType entity to a BuildType reference

func (*BuildType) UnmarshalJSON

func (b *BuildType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for TriggerSchedule

type BuildTypeOptions

type BuildTypeOptions struct {
	AllowPersonalBuildTriggering bool     `prop:"allowPersonalBuildTriggering" force:""`
	ArtifactRules                []string `prop:"artifactRules" separator:"\n"`
	EnableHangingBuildsDetection bool     `prop:"enableHangingBuildsDetection" force:""`
	EnableStatusWidget           bool     `prop:"allowExternalStatus"`
	BuildCounter                 int      `prop:"buildNumberCounter"`
	CleanBuild                   bool     `prop:"cleanBuild"`
	CheckoutMode                 string   `prop:"checkoutMode"`
	BuildNumberFormat            string   `prop:"buildNumberPattern"`
	BuildConfigurationType       string   `prop:"buildConfigurationType"`
	MaxSimultaneousBuilds        int      `prop:"maximumNumberOfBuilds"`
	Template                     bool
	BuildTypeID                  int
}

BuildTypeOptions represents settings for a Build Configuration

func NewBuildTypeOptionsTemplate

func NewBuildTypeOptionsTemplate() *BuildTypeOptions

NewBuildTypeOptionsTemplate returns a new instance of settings for a BuildType Template.

func NewBuildTypeOptionsWithDefaults

func NewBuildTypeOptionsWithDefaults() *BuildTypeOptions

NewBuildTypeOptionsWithDefaults returns a new instance of default settings, the same as presented in the TeamCity UI when a new build configuration is created.

type BuildTypeReference

type BuildTypeReference struct {

	// id
	ID string `json:"id,omitempty" xml:"id"`

	// name
	Name string `json:"name,omitempty" xml:"name"`

	// project Id
	ProjectID string `json:"projectId,omitempty" xml:"projectId"`
}

BuildTypeReference represents a subset detail of a Build Type

type BuildTypeReferences

type BuildTypeReferences struct {
	// count
	Count int32 `json:"count,omitempty" xml:"count"`

	// buildType
	Items []*BuildTypeReference `json:"buildType"`
}

BuildTypeReferences represents a collection of *BuildTypeReference

type BuildTypeService

type BuildTypeService struct {
	// contains filtered or unexported fields
}

BuildTypeService has operations for handling build configurations and templates

func (*BuildTypeService) AddStep

func (s *BuildTypeService) AddStep(id string, step Step) (Step, error)

AddStep creates a new build step for the build configuration with given id.

func (*BuildTypeService) AttachVcsRoot

func (s *BuildTypeService) AttachVcsRoot(id string, vcsRoot *VcsRootReference) error

AttachVcsRoot adds the VcsRoot reference to this build type

func (*BuildTypeService) AttachVcsRootEntry

func (s *BuildTypeService) AttachVcsRootEntry(id string, entry *VcsRootEntry) error

AttachVcsRootEntry adds the VcsRootEntry to this build type

func (*BuildTypeService) Create

func (s *BuildTypeService) Create(projectID string, buildType *BuildType) (*BuildTypeReference, error)

Create creates a new build type under a project NOTE: the "projectID" field is unused - set the ProjectID field on `buildType` instead

func (*BuildTypeService) Delete

func (s *BuildTypeService) Delete(id string) error

Delete a build type resource

func (*BuildTypeService) DeleteStep

func (s *BuildTypeService) DeleteStep(id string, stepID string) error

DeleteStep removes a build step from this build type by its id

func (*BuildTypeService) GetByID

func (s *BuildTypeService) GetByID(id string) (*BuildType, error)

GetByID Retrieves a build type resource by ID

func (*BuildTypeService) GetSteps

func (s *BuildTypeService) GetSteps(id string) ([]Step, error)

GetSteps return the list of steps for a Build configuration with given id.

func (*BuildTypeService) Update

func (s *BuildTypeService) Update(buildType *BuildType) (*BuildType, error)

Update changes the resource in-place for this build configuration. TeamCity API does not support "PUT" on the whole Build Configuration resource, so the only updateable fields are "Name" and "Description". Other field updates will be ignored. This method also updates Settings and Parameters, but this is not an atomic operation. If an error occurs, it will be returned to caller what was updated or not.

func (*BuildTypeService) UpdateSettings

func (s *BuildTypeService) UpdateSettings(id string, settings *Properties) error

UpdateSettings will do a remote call for each setting being updated. Operation is not atomic, and the list of settings is processed in the order sent. Will return the error of the first failure and not process the rest

type Client

type Client struct {
	HTTPClient   *http.Client
	RetryTimeout time.Duration

	AgentPools      *AgentPoolsService
	Projects        *ProjectService
	BuildTypes      *BuildTypeService
	Server          *ServerService
	VcsRoots        *VcsRootService
	Groups          *GroupService
	RoleAssignments *RoleAssignmentService
	// contains filtered or unexported fields
}

Client represents the base for connecting to TeamCity

func New

func New(userName, password string, httpClient *http.Client) (*Client, error)

New creates a new client for server address specified at TEAMCITY_ADDR environment variable Deprecated

func NewClient

func NewClient(auth Auth, httpClient *http.Client) (*Client, error)

func NewClientWithAddress

func NewClientWithAddress(auth Auth, address string, httpClient *http.Client) (*Client, error)

func NewWithAddress

func NewWithAddress(userName, password, address string, httpClient *http.Client) (*Client, error)

NewWithAddress creates a new client by using the explicit server address from the parameter Deprecated

func (*Client) AgentRequirementService

func (c *Client) AgentRequirementService(id string) *AgentRequirementService

AgentRequirementService returns a service to manage agent requirements for a build configuration with given id

func (*Client) BuildFeatureService

func (c *Client) BuildFeatureService(id string) *BuildFeatureService

BuildFeatureService returns a service to manage agent requirements for a build configuration with given id

func (*Client) BuildTemplateService

func (c *Client) BuildTemplateService(id string) *BuildTemplateService

BuildTemplateService returns a service to manage template associations for a build configuration with given id

func (*Client) DependencyService

func (c *Client) DependencyService(id string) *DependencyService

DependencyService returns a service to manage snapshot and artifact dependencies for a build configuration with given id

func (*Client) ProjectFeatureService

func (c *Client) ProjectFeatureService(id string) *ProjectFeatureService

ProjectFeatureService returns a service to manage project features for a project with given id

func (*Client) SlingClient

func (c *Client) SlingClient() *sling.Sling

func (*Client) TriggerService

func (c *Client) TriggerService(buildTypeID string) *TriggerService

TriggerService returns a service to manage build triggers for a build configuration with given id

func (*Client) Validate

func (c *Client) Validate() (bool, error)

Validate tests if the client is properly configured and can be used

type CreateAgentPool

type CreateAgentPool struct {
	Name      string `json:"name,omitempty" xml:"name"`
	MaxAgents *int   `json:"maxAgents,omitempty" xml:"maxAgents"`
}

CreateAgentPool contains information needed to create an Agent Pool

type CredentialsStorageType

type CredentialsStorageType string

CredentialsStorageType represents how credentials should be stored in versioned settings

const (
	// Credentials should be scrambled and stored in VCS
	CredentialsStorageTypeScrambledInVcs CredentialsStorageType = ""

	// Credentials should be stored as Secure Tokens within the Project
	CredentialsStorageTypeCredentialsJSON CredentialsStorageType = "credentialsJSON"
)

type Dependency

type Dependency interface {
	ID() string
	Type() string
	SetBuildTypeID(string)
	BuildTypeID() string
}

Dependency is an interface representing a Build dependency, for creating build chains

type DependencyService

type DependencyService struct {
	BuildTypeID string
	// contains filtered or unexported fields
}

DependencyService provides operations for managing dependencies for a buildType

func NewDependencyService

func NewDependencyService(buildTypeID string, c *http.Client, base *sling.Sling) *DependencyService

NewDependencyService constructs and instance of DependencyService scoped to a given buildTypeId

func (*DependencyService) AddArtifactDependency

func (s *DependencyService) AddArtifactDependency(dep *ArtifactDependency) (*ArtifactDependency, error)

AddArtifactDependency adds a new artifact dependency to build type

func (*DependencyService) AddSnapshotDependency

func (s *DependencyService) AddSnapshotDependency(dep *SnapshotDependency) (*SnapshotDependency, error)

AddSnapshotDependency adds a new snapshot dependency to build type

func (*DependencyService) DeleteArtifact

func (s *DependencyService) DeleteArtifact(depID string) error

DeleteArtifact removes an artifact dependency from the build configuration by its id

func (*DependencyService) DeleteSnapshot

func (s *DependencyService) DeleteSnapshot(depID string) error

DeleteSnapshot removes a snapshot dependency from the build configuration by its id

func (*DependencyService) GetArtifactByID

func (s *DependencyService) GetArtifactByID(depID string) (*ArtifactDependency, error)

GetArtifactByID returns an artifact dependency by its id

func (*DependencyService) GetSnapshotByID

func (s *DependencyService) GetSnapshotByID(depID string) (*SnapshotDependency, error)

GetSnapshotByID returns a snapshot dependency by its id

type FeatureCommitStatusPublisher

type FeatureCommitStatusPublisher struct {
	Options FeatureCommitStatusPublisherOptions
	// contains filtered or unexported fields
}

FeatureCommitStatusPublisher represents a commit status publisher build feature. Implements BuildFeature interface

func NewFeatureCommitStatusPublisherGithub

func NewFeatureCommitStatusPublisherGithub(opt StatusPublisherGithubOptions, vcsRootID string) (*FeatureCommitStatusPublisher, error)

NewFeatureCommitStatusPublisherGithub creates a Build Feature Commit status Publisher to Github with the given options and validates the required properties. VcsRootID is optional - if empty, it will apply the commit publisher feature to all VCS roots.

func (*FeatureCommitStatusPublisher) BuildTypeID

func (f *FeatureCommitStatusPublisher) BuildTypeID() string

BuildTypeID is a getter for the Build Type ID associated with this build feature.

func (*FeatureCommitStatusPublisher) Disabled

func (f *FeatureCommitStatusPublisher) Disabled() bool

Disabled returns whether this build feature is disabled or not.

func (*FeatureCommitStatusPublisher) ID

ID returns the ID for this instance.

func (*FeatureCommitStatusPublisher) MarshalJSON

func (f *FeatureCommitStatusPublisher) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for FeatureCommitStatusPublisher

func (*FeatureCommitStatusPublisher) Properties

func (f *FeatureCommitStatusPublisher) Properties() *Properties

Properties returns a *Properties instance representing a serializable collection to be used.

func (*FeatureCommitStatusPublisher) SetBuildTypeID

func (f *FeatureCommitStatusPublisher) SetBuildTypeID(value string)

SetBuildTypeID is a setter for the Build Type ID associated with this build feature.

func (*FeatureCommitStatusPublisher) SetDisabled

func (f *FeatureCommitStatusPublisher) SetDisabled(value bool)

SetDisabled sets whether this build feature is disabled or not.

func (*FeatureCommitStatusPublisher) SetID

func (f *FeatureCommitStatusPublisher) SetID(value string)

SetID sets the ID for this instance.

func (*FeatureCommitStatusPublisher) SetVcsRootID

func (f *FeatureCommitStatusPublisher) SetVcsRootID(value string)

SetVcsRootID sets the VCS Root ID that this build feature is associated with.

func (*FeatureCommitStatusPublisher) Type

Type returns the "commit-status-publisher", the keyed-type for this build feature instance

func (*FeatureCommitStatusPublisher) UnmarshalJSON

func (f *FeatureCommitStatusPublisher) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for FeatureCommitStatusPublisher

func (*FeatureCommitStatusPublisher) VcsRootID

func (f *FeatureCommitStatusPublisher) VcsRootID() string

VcsRootID returns the VCS Root ID that this build feature is associated with.

type FeatureCommitStatusPublisherOptions

type FeatureCommitStatusPublisherOptions interface {
	Properties() *Properties
}

FeatureCommitStatusPublisherOptions represents options needed to create a commit status publisher build feature

type FeatureGolangPublisher

type FeatureGolangPublisher struct {
	// contains filtered or unexported fields
}

FeatureCommitStatusPublisher represents a golang build feature. Implements BuildFeature interface

func NewFeatureGolang

func NewFeatureGolang() *FeatureGolangPublisher

NewFeatureGolang returns a new instance of the FeatureGolangPublisher struct

func (*FeatureGolangPublisher) BuildTypeID

func (f *FeatureGolangPublisher) BuildTypeID() string

BuildTypeID is a getter for the Build Type ID associated with this build feature.

func (*FeatureGolangPublisher) Disabled

func (f *FeatureGolangPublisher) Disabled() bool

Disabled returns whether this build feature is disabled or not.

func (*FeatureGolangPublisher) ID

ID returns the ID for this instance.

func (*FeatureGolangPublisher) MarshalJSON

func (f *FeatureGolangPublisher) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for FeatureCommitStatusPublisher

func (*FeatureGolangPublisher) Properties

func (f *FeatureGolangPublisher) Properties() *Properties

Properties returns a *Properties instance representing a serializable collection to be used.

func (*FeatureGolangPublisher) SetBuildTypeID

func (f *FeatureGolangPublisher) SetBuildTypeID(value string)

SetBuildTypeID is a setter for the Build Type ID associated with this build feature.

func (*FeatureGolangPublisher) SetDisabled

func (f *FeatureGolangPublisher) SetDisabled(value bool)

SetDisabled sets whether this build feature is disabled or not.

func (*FeatureGolangPublisher) SetID

func (f *FeatureGolangPublisher) SetID(value string)

SetID sets the ID for this instance.

func (*FeatureGolangPublisher) Type

func (f *FeatureGolangPublisher) Type() string

Type returns the "commit-status-publisher", the keyed-type for this build feature instance

func (*FeatureGolangPublisher) UnmarshalJSON

func (f *FeatureGolangPublisher) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for FeatureCommitStatusPublisher

type FeaturePullRequests

type FeaturePullRequests struct {
	Options FeaturePullRequestsOptions
	// contains filtered or unexported fields
}

FeaturePullRequests represents a commit status publisher build feature. Implements BuildFeature interface

func NewFeaturePullRequestsGithub

func NewFeaturePullRequestsGithub(opt PullRequestsGithubOptions, vcsRootID string) (*FeaturePullRequests, error)

NewFeaturePullRequestsGithub creates a Build Feature Commit status Publisher to Github with the given options and validates the required properties. VcsRootID is optional - if empty, it will apply the commit publisher feature to all VCS roots.

func (*FeaturePullRequests) BuildTypeID

func (f *FeaturePullRequests) BuildTypeID() string

BuildTypeID is a getter for the Build Type ID associated with this build feature.

func (*FeaturePullRequests) Disabled

func (f *FeaturePullRequests) Disabled() bool

Disabled returns whether this build feature is disabled or not.

func (*FeaturePullRequests) ID

func (f *FeaturePullRequests) ID() string

ID returns the ID for this instance.

func (*FeaturePullRequests) MarshalJSON

func (f *FeaturePullRequests) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for FeaturePullRequests

func (*FeaturePullRequests) Properties

func (f *FeaturePullRequests) Properties() *Properties

Properties returns a *Properties instance representing a serializable collection to be used.

func (*FeaturePullRequests) SetBuildTypeID

func (f *FeaturePullRequests) SetBuildTypeID(value string)

SetBuildTypeID is a setter for the Build Type ID associated with this build feature.

func (*FeaturePullRequests) SetDisabled

func (f *FeaturePullRequests) SetDisabled(value bool)

SetDisabled sets whether this build feature is disabled or not.

func (*FeaturePullRequests) SetID

func (f *FeaturePullRequests) SetID(value string)

SetID sets the ID for this instance.

func (*FeaturePullRequests) SetVcsRootID

func (f *FeaturePullRequests) SetVcsRootID(value string)

SetVcsRootID sets the VCS Root ID that this build feature is associated with.

func (*FeaturePullRequests) Type

func (f *FeaturePullRequests) Type() string

Type returns the "commit-status-publisher", the keyed-type for this build feature instance

func (*FeaturePullRequests) UnmarshalJSON

func (f *FeaturePullRequests) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for FeaturePullRequests

func (*FeaturePullRequests) VcsRootID

func (f *FeaturePullRequests) VcsRootID() string

VcsRootID returns the VCS Root ID that this build feature is associated with.

type FeaturePullRequestsOptions

type FeaturePullRequestsOptions interface {
	Properties() *Properties
}

FeaturePullRequestsOptions represents options needed to create a commit status publisher build feature

type FeatureSshAgent

type FeatureSshAgent struct {
	Options FeatureSshAgentOptions
	// contains filtered or unexported fields
}

FeatureSshAgent represents a commit status publisher build feature. Implements BuildFeature interface

func NewFeatureSshAgent

func NewFeatureSshAgent(opt SshAgentOptions) (*FeatureSshAgent, error)

NewFeatureSshAgent creates a Build Feature Commit status Publisher to Github with the given options and validates the required properties. VcsRootID is optional - if empty, it will apply the commit publisher feature to all VCS roots.

func (*FeatureSshAgent) BuildTypeID

func (f *FeatureSshAgent) BuildTypeID() string

BuildTypeID is a getter for the Build Type ID associated with this build feature.

func (*FeatureSshAgent) Disabled

func (f *FeatureSshAgent) Disabled() bool

Disabled returns whether this build feature is disabled or not.

func (*FeatureSshAgent) ID

func (f *FeatureSshAgent) ID() string

ID returns the ID for this instance.

func (*FeatureSshAgent) MarshalJSON

func (f *FeatureSshAgent) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for FeatureSshAgent

func (*FeatureSshAgent) Properties

func (f *FeatureSshAgent) Properties() *Properties

Properties returns a *Properties instance representing a serializable collection to be used.

func (*FeatureSshAgent) SetBuildTypeID

func (f *FeatureSshAgent) SetBuildTypeID(value string)

SetBuildTypeID is a setter for the Build Type ID associated with this build feature.

func (*FeatureSshAgent) SetDisabled

func (f *FeatureSshAgent) SetDisabled(value bool)

SetDisabled sets whether this build feature is disabled or not.

func (*FeatureSshAgent) SetID

func (f *FeatureSshAgent) SetID(value string)

SetID sets the ID for this instance.

func (*FeatureSshAgent) Type

func (f *FeatureSshAgent) Type() string

Type returns the "commit-status-publisher", the keyed-type for this build feature instance

func (*FeatureSshAgent) UnmarshalJSON

func (f *FeatureSshAgent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for FeatureSshAgent

type FeatureSshAgentOptions

type FeatureSshAgentOptions interface {
	Properties() *Properties
}

FeatureSshAgentOptions represents options needed to create a commit status publisher build feature

type Features

type Features struct {
	Count int32              `json:"count,omitempty" xml:"count"`
	Href  string             `json:"href,omitempty" xml:"href"`
	Items []buildFeatureJSON `json:"feature"`
}

Features is a collection of BuildFeature

type GitAgentCleanFilesPolicy

type GitAgentCleanFilesPolicy string

GitAgentCleanFilesPolicy enum specifies which files will be removed when "git clean" command is run on agent.

const (

	//CleanFilesPolicyAllUntracked will clean all untracked files
	CleanFilesPolicyAllUntracked GitAgentCleanFilesPolicy = "ALL_UNTRACKED"

	//CleanFilesPolicyIgnoredOnly will clean all ignored files
	CleanFilesPolicyIgnoredOnly GitAgentCleanFilesPolicy = "IGNORED_ONLY"

	//CleanFilesPolicyIgnoredUntracked will clean all non-ignored untracked files
	CleanFilesPolicyIgnoredUntracked GitAgentCleanFilesPolicy = "NON_IGNORED_ONLY"
)

type GitAgentCleanPolicy

type GitAgentCleanPolicy string

GitAgentCleanPolicy enum specifies when the "git clean" should be run on the agent.

const (
	//CleanPolicyBranchChange run clean whenever a branch change is detected
	CleanPolicyBranchChange GitAgentCleanPolicy = "ON_BRANCH_CHANGE"

	//CleanPolicyAlways always run 'git clean'
	CleanPolicyAlways GitAgentCleanPolicy = "ALWAYS"

	//CleanPolicyNever never run 'git clean'
	CleanPolicyNever GitAgentCleanPolicy = "NEVER"
)

type GitAgentSettings

type GitAgentSettings struct {

	//GitPath is the path to a git executable on the agent. If blank, the location set up in TEAMCITY_GIT_PATH environment variable is used.
	GitPath string `prop:"agentGitPath"`

	//CleanPolicy specifies when the "git clean" command is run on the agent. Defaults to 'CleanPolicyBranchChange'
	CleanPolicy GitAgentCleanPolicy `prop:"agentCleanPolicy"`

	//CleanFilesPolicy specifies which files will be removed when "git clean" command is run on agent.
	CleanFilesPolicy GitAgentCleanFilesPolicy `prop:"agentCleanFilesPolicy"`

	//UseMirrors when enabled, TeamCity creates a separate clone of the repository on each agent and uses it in the checkout directory via git alternates.
	UseMirrors bool `prop:"useAlternates"`
}

GitAgentSettings are agent-specific settings that are used in case of agent checkout

type GitAuthMethod

type GitAuthMethod string

GitAuthMethod enum is to specify the authentication method when connecting to Git VCS.

const (
	//GitAuthMethodAnonymous is used for anonymously connecting to Git VCS.
	GitAuthMethodAnonymous GitAuthMethod = "ANONYMOUS"

	//GitAuthMethodPassword is used for connecting using username/password to Git VCS.
	GitAuthMethodPassword GitAuthMethod = "PASSWORD"

	//GitAuthSSHUploadedKey is used for connecting using SSH with a Private Key uploaded to TeamCity
	GitAuthSSHUploadedKey GitAuthMethod = "TEAMCITY_SSH_KEY"

	//GitAuthSSHDefaultKey is used for connecting using SSH and uses mapping specified in the file /root/.ssh/config if that file exists.
	GitAuthSSHDefaultKey GitAuthMethod = "PRIVATE_KEY_DEFAULT"

	//GitAuthSSHCustomKey is used for connecting using SSH with a custom private key in the given path.
	GitAuthSSHCustomKey GitAuthMethod = "PRIVATE_KEY_FILE"
)

type GitVcsRoot

type GitVcsRoot struct {
	Options *GitVcsRootOptions

	// id
	ID string `json:"id,omitempty" xml:"id"`

	// project
	Project *ProjectReference `json:"project,omitempty"`
	// contains filtered or unexported fields
}

GitVcsRoot is a VCS Root of type Git, strongly-typed model.

func NewGitVcsRoot

func NewGitVcsRoot(projectID string, name string, opts *GitVcsRootOptions) (*GitVcsRoot, error)

NewGitVcsRoot returns a VCS Root instance that connects to Git VCS.

func (*GitVcsRoot) GetID

func (d *GitVcsRoot) GetID() string

GetID returns the ID of this VCS Root.

func (*GitVcsRoot) MarshalJSON

func (d *GitVcsRoot) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for GitVcsRoot

func (*GitVcsRoot) ModificationCheckInterval

func (d *GitVcsRoot) ModificationCheckInterval() *int32

ModificationCheckInterval returns how often TeamCity polls the VCS repository for VCS changes (in seconds).

func (*GitVcsRoot) Name

func (d *GitVcsRoot) Name() string

Name returns the name of VCS Root.

func (*GitVcsRoot) ProjectID

func (d *GitVcsRoot) ProjectID() string

ProjectID returns the projectID where this VCS Root is defined

func (*GitVcsRoot) Properties

func (d *GitVcsRoot) Properties() *Properties

Properties returns the properties for this VCS Root

func (*GitVcsRoot) SetModificationCheckInterval

func (d *GitVcsRoot) SetModificationCheckInterval(seconds int32)

SetModificationCheckInterval specifies how often TeamCity polls the VCS repository for VCS changes (in seconds).

func (*GitVcsRoot) SetName

func (d *GitVcsRoot) SetName(name string)

SetName changes the name of VCS Root.

func (*GitVcsRoot) SetProjectID

func (d *GitVcsRoot) SetProjectID(id string)

SetProjectID specifies the project for this VCS Root. When moving VCS Roots between projects, it must not be in use by any other build configurations or sub-projects.

func (*GitVcsRoot) UnmarshalJSON

func (d *GitVcsRoot) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for GitVcsRoot

func (*GitVcsRoot) VcsName

func (d *GitVcsRoot) VcsName() string

VcsName returns the type of VCS Root. See VcsNames

type GitVcsRootOptions

type GitVcsRootOptions struct {
	//DefaultBranch indicates which main branch or tag to be monitored by the VCS Root. Requied.
	DefaultBranch string `prop:"branch"`

	//BranchSpec are monitor besides the default one as a newline-delimited set of rules in the form of +|-:branch name (with the optional * placeholder)
	//Set separately, outside constructor.
	BranchSpec []string `prop:"teamcity:branchSpec" separator:"\n"`

	//FetchURL is used for fetching data from the repository. Required.
	FetchURL string `prop:"url"`

	//PushURL is used for pushing tags to the remote repository. If blank, the fetch url is used.
	PushURL string `prop:"push_url"`

	//EnableTagsInBranchSpec enable/disable use tags in branch specification. Defaults to false. Set separately, outside constructor.
	EnableTagsInBranchSpec bool `prop:"reportTagRevisions"`

	//AuthMethod controls how the TeamCity server will authenticate against the VCS Git provider. Required.
	AuthMethod GitAuthMethod `prop:"authMethod"`

	//Username is used for methods other than "GitAuthMethodAnonymous". For SSH, it overrides the username used in the Fetch/Push URLs.
	Username string `prop:"username"`

	//Password represents the user password when "GitAuthMethodPassword" auth method is used.
	//Password is the key passphrase when "GitAuthSSHUploadedKey" or "GitAuthSSHCustomKey" with auth methods are used.
	Password string `prop:"secure:password"`

	//PrivateKeySource is used for "GitAuthSSHCustomKey" as the key path on disk.
	//PrivateKeySource is used for "GitAuthSSHUploadedKey" as the name of the SSH Key uploaded for the project in "SSH Keys"
	PrivateKeySource string `prop:"secure:passphrase"`

	//AgentSettings control agent-specific settings that are used in case of agent checkout
	AgentSettings *GitAgentSettings

	//SubModuleCheckout specifies whether checkout Git submodules or ignore.
	//Possible values are 'CHECKOUT' or 'IGNORE'. Defaults to 'CHECKOUT'. Set separately, outside constructor.
	SubModuleCheckout string `prop:"submoduleCheckout"`

	// UsernameStyle defines a way TeamCity binds VCS changes to the user.
	// Defaults to 'GitVcsUsernameStyleUserID'. Set separately, outside constructor.
	UsernameStyle GitVcsUsernameStyle `prop:"usernameStyle"`
}

GitVcsRootOptions represents parameters used when manipulating VCS Roots of type "Git"

func NewGitVcsRootOptions

func NewGitVcsRootOptions(defaultBranch string, fetchURL string, pushURL string, auth GitAuthMethod, username string, password string) (*GitVcsRootOptions, error)

NewGitVcsRootOptions returns a new instance of GitVcsRootOptions with default GitAgentSettings

func NewGitVcsRootOptionsDefaults

func NewGitVcsRootOptionsDefaults(defaultBranch string, fetchURL string) (*GitVcsRootOptions, error)

NewGitVcsRootOptionsDefaults returns a new instance of GitVcsRootOptions with default values Anonymous auth method Default AgentSettings

func NewGitVcsRootOptionsWithAgentSettings

func NewGitVcsRootOptionsWithAgentSettings(defaultBranch string, fetchURL string, pushURL string, auth GitAuthMethod, username string, password string, agentSettings *GitAgentSettings) (*GitVcsRootOptions, error)

NewGitVcsRootOptionsWithAgentSettings returns a new instance of GitVcsRootOptions with specified GitAgentSettings

type GitVcsUsernameStyle

type GitVcsUsernameStyle string

GitVcsUsernameStyle defines a way TeamCity binds VCS changes to the user. With selected style and the following content of ~/.gitconfig: [user] name = Joe Coder email = joe.coder@acme.com

const (
	//GitVcsUsernameStyleUserID should configure 'joe.coder' in the VCS profile for the User.
	GitVcsUsernameStyleUserID GitVcsUsernameStyle = "USERID"
	//GitVcsUsernameStyleAuthorName should configure 'Joe Coder' in the VCS profile for the User.
	GitVcsUsernameStyleAuthorName GitVcsUsernameStyle = "NAME"
	//GitVcsUsernameStyleAuthorEmail should configure 'joe.coder@acme.com' in the VCS profile for the User.
	GitVcsUsernameStyleAuthorEmail GitVcsUsernameStyle = "EMAIL"
	//GitVcsUsernameStyleAuthorNameAndEmail should configure 'Joe Coder <joe.coder@acme.com>' in the VCS profile for the User.
	GitVcsUsernameStyleAuthorNameAndEmail GitVcsUsernameStyle = "FULL"
)

type Group

type Group struct {
	Key         string `json:"key,omitempty" xml:"key"`
	Description string `json:"description,omitempty" xml:"description"`
	Name        string `json:"name,omitempty" xml:"name"`
}

Group is the model for group entities in TeamCity

func NewGroup

func NewGroup(key string, name string, description string) (*Group, error)

NewGroup returns an instance of a Group. A non-empty Key and Name is required. Description can be an empty string and will be omitted.

type GroupRoleAssignment

type GroupRoleAssignment struct {
	GroupKey string //`json:"groupkey,omitempty" xml:"groupkey"`
	RoleID   string //`json:"roleid,omitempty" xml:"roleid"`
	Scope    string //`json:"scope,omitempty" xml:"scope"`
}

GroupRoleAssignment is the model for role assignment for groups in TeamCity

func NewGroupRoleAssignment

func NewGroupRoleAssignment(groupKey string, roleID string, scope string) (*GroupRoleAssignment, error)

NewGroupRoleAssignment returns an instance of a GroupRoleAssignment. A non-empty groupKey, roleId, and scope is required.

type GroupService

type GroupService struct {
	// contains filtered or unexported fields
}

GroupService has operations for handling groups

func (*GroupService) Create

func (s *GroupService) Create(group *Group) (*Group, error)

Create - Creates a new group

func (*GroupService) Delete

func (s *GroupService) Delete(key string) error

Delete - Deletes a group by its group key

func (*GroupService) GetByKey

func (s *GroupService) GetByKey(key string) (*Group, error)

GetByKey - Get a group by its group key

type ListAgentPools

type ListAgentPools struct {
	Count      int                  `json:"count,omitempty" xml:"count"`
	Href       string               `json:"href,omitempty" xml:"href"`
	AgentPools []AgentPoolReference `json:"agentPool,omitempty" xml:"agentPool"`
}

ListAgentPools is the response object when listing Agent Pools

type Locator

type Locator string

Locator represents a arbitraty locator to be used when querying resources, such as id:, type:, or key: These are used in GET requests within the URL so must be properly escaped

func LocatorID

func LocatorID(id string) Locator

LocatorID creates a locator for a Project/BuildType by Id

func LocatorIDInt

func LocatorIDInt(id int) Locator

LocatorIDInt creates a locator for a Project/BuildType by Id where the Id's an integer

func LocatorKey

func LocatorKey(key string) Locator

LocatorKey creates a locator for Group by Key

func LocatorName

func LocatorName(name string) Locator

LocatorName creates a locator for Project/BuildType by Name

func LocatorType

func LocatorType(id string) Locator

LocatorType creates a locator for a Project Feature by Type

func (Locator) String

func (l Locator) String() string

type Parameter

type Parameter struct {
	Inherited bool `json:"inherited,omitempty" xml:"inherited"`

	Name string `json:"name,omitempty" xml:"name"`

	Value string `json:"value" xml:"value"`

	Type string `json:"-"`

	Spec string `json:"-"`
}

Parameter represents a project or build configuration parameter that may be defined as "configuration", "system" or "environment variable"

func NewParameter

func NewParameter(t string, name string, value string, spec string) (*Parameter, error)

NewParameter creates a new instance of a parameter with the given type

func (*Parameter) MarshalJSON

func (p *Parameter) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for Parameter

func (*Parameter) Property

func (p *Parameter) Property() *Property

Property converts a Parameter instance to a Property

func (*Parameter) UnmarshalJSON

func (p *Parameter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for Parameter

type Parameters

type Parameters struct {
	Count int32        `json:"count,omitempty" xml:"count"`
	Href  string       `json:"href,omitempty" xml:"href"`
	Items []*Parameter `json:"property,omitempty"`
}

Parameters is a strongly-typed collection of "Parameter" suitable for serialization

func NewParameters

func NewParameters(items ...*Parameter) *Parameters

NewParameters returns an instance of Parameters collection with the given parameters slice

func NewParametersEmpty

func NewParametersEmpty() *Parameters

NewParametersEmpty returns an empty collection of Parameters

func (*Parameters) Add

func (p *Parameters) Add(param *Parameter)

Add a new parameter to this collection

func (*Parameters) AddOrReplaceParameter

func (p *Parameters) AddOrReplaceParameter(param *Parameter)

AddOrReplaceParameter will update a parameter value if another parameter with the same name exists. It won't replace the Parameter struct within the Parameters collection.

func (*Parameters) AddOrReplaceValue

func (p *Parameters) AddOrReplaceValue(t string, n string, v string, s string)

AddOrReplaceValue will update a parameter value if it exists, or add if it doesnt

func (*Parameters) Concat

func (p *Parameters) Concat(source *Parameters) *Parameters

Concat appends the source Parameters collection to this collection and returns the appended collection

func (*Parameters) GetOk

func (p *Parameters) GetOk(t string, n string) (out *Parameter, ok bool)

GetOk returns a Parameter by it's type/name combination

func (*Parameters) NonInherited

func (p *Parameters) NonInherited() (po *Parameters)

NonInherited returns a new Parameters collection filtering out all inherited parameters

func (*Parameters) Properties

func (p *Parameters) Properties() *Properties

Properties convert a Parameters collection to a Properties collection

func (*Parameters) Remove

func (p *Parameters) Remove(t string, n string)

Remove a parameter if it exists in the collection

type Project

type Project struct {
	Archived        *bool               `json:"archived,omitempty" xml:"archived"`
	Description     string              `json:"description,omitempty" xml:"description"`
	Href            string              `json:"href,omitempty" xml:"href"`
	ID              string              `json:"id,omitempty" xml:"id"`
	Name            string              `json:"name,omitempty" xml:"name"`
	Parameters      *Parameters         `json:"parameters,omitempty"`
	ParentProject   *ProjectReference   `json:"parentProject,omitempty"`
	ParentProjectID string              `json:"parentProjectId,omitempty" xml:"parentProjectId"`
	WebURL          string              `json:"webUrl,omitempty" xml:"webUrl"`
	BuildTypes      BuildTypeReferences `json:"buildTypes,omitempty" xml:"buildTypes"`
	ChildProjects   ProjectsReferences  `json:"projects,omitempty" xml:"projects"`
}

Project is the model for project entities in TeamCity

func NewProject

func NewProject(name string, description string, parentProjectID string) (*Project, error)

NewProject returns an instance of a Project. A non-empty name is required. Description can be an empty string and will be omitted. For creating a top-level project, pass empty to parentProjectId.

func (*Project) ProjectReference

func (p *Project) ProjectReference() *ProjectReference

ProjectReference converts a project instance to a ProjectReference

func (*Project) SetParentProject

func (p *Project) SetParentProject(parentID string)

SetParentProject changes this Project instance's parent project

type ProjectFeature

type ProjectFeature interface {
	ID() string
	SetID(value string)

	Type() string

	ProjectID() string
	SetProjectID(value string)

	Properties() *Properties
}

The ProjectFeature interface represents the different types of features that can be added to a project.

type ProjectFeatureService

type ProjectFeatureService struct {
	ProjectID string
	// contains filtered or unexported fields
}

ProjectFeatureService provides operations for managing project features.

func (*ProjectFeatureService) Create

Create creates a new ProjectFeature under the current project.

func (*ProjectFeatureService) Delete

func (s *ProjectFeatureService) Delete(id string) error

Delete removes a single ProjectFeature for the current project by it's id.

func (*ProjectFeatureService) Get

Get all project features for the current project.

func (*ProjectFeatureService) GetByID

GetByID returns a single ProjectFeature for the current project by it's id.

func (*ProjectFeatureService) GetByType

func (s *ProjectFeatureService) GetByType(id string) (ProjectFeature, error)

GetByType returns a single ProjectFeature for the current project by it's typw.

func (*ProjectFeatureService) Update

Update updated an existing a ProjectFeature under the current project.

type ProjectFeatureVersionedSettings

type ProjectFeatureVersionedSettings struct {
	Options ProjectFeatureVersionedSettingsOptions
	// contains filtered or unexported fields
}

ProjectFeatureVersionedSettings represents the versioned settings feature for a project. Can be used to configure https://confluence.jetbrains.com/display/TCD10/Storing+Project+Settings+in+Version+Control.

func NewProjectFeatureVersionedSettings

func NewProjectFeatureVersionedSettings(projectID string, options ProjectFeatureVersionedSettingsOptions) *ProjectFeatureVersionedSettings

NewProjectFeatureVersionedSettings creates a new Versioned Settings project feature.

func (*ProjectFeatureVersionedSettings) ID

ID returns the ID of this project feature.

func (*ProjectFeatureVersionedSettings) ProjectID

func (f *ProjectFeatureVersionedSettings) ProjectID() string

ProjectID represents the ID of the project the project feature is assigned to.

func (*ProjectFeatureVersionedSettings) Properties

Properties returns all properties for the versioned settings project feature.

func (*ProjectFeatureVersionedSettings) SetID

func (f *ProjectFeatureVersionedSettings) SetID(value string)

SetID sets the ID of this project feature.

func (*ProjectFeatureVersionedSettings) SetProjectID

func (f *ProjectFeatureVersionedSettings) SetProjectID(value string)

SetProjectID sets the ID of the project the project feature is assigned to.

func (*ProjectFeatureVersionedSettings) Type

Type represents the type of the project feature as a string.

type ProjectFeatureVersionedSettingsOptions

type ProjectFeatureVersionedSettingsOptions struct {
	Enabled                bool
	ShowChanges            bool
	UseRelativeIds         bool
	VcsRootID              string
	Format                 VersionedSettingsFormat
	BuildSettings          VersionedSettingsBuildSettings
	CredentialsStorageType CredentialsStorageType
	ContextParameters      map[string]string
}

ProjectFeatureVersionedSettingsOptions holds all properties for the versioned settings project feature.

type ProjectReference

type ProjectReference struct {
	ID          string `json:"id,omitempty" xml:"id"`
	Name        string `json:"name,omitempty" xml:"name"`
	Description string `json:"description,omitempty" xml:"description"`
	Href        string `json:"href,omitempty" xml:"href"`
	WebURL      string `json:"webUrl,omitempty" xml:"webUrl"`
}

ProjectReference contains basic information, usually enough to use as a type for relationships. In addition to that, TeamCity does not return the full detailed representation when creating objects, thus the need for a reference.

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

ProjectService has operations for handling projects

func (*ProjectService) Create

func (s *ProjectService) Create(project *Project) (*Project, error)

Create creates a new project at root project level

func (*ProjectService) Delete

func (s *ProjectService) Delete(id string) error

Delete - Deletes a project

func (*ProjectService) GetByID

func (s *ProjectService) GetByID(id string) (*Project, error)

GetByID Retrieves a project resource by ID

func (*ProjectService) GetByName

func (s *ProjectService) GetByName(name string) (*Project, error)

GetByName returns a project by its name. There are no duplicate names in projects for TeamCity

func (*ProjectService) Update

func (s *ProjectService) Update(project *Project) (*Project, error)

Update changes the resource in-place for this project. TeamCity API does not support "PUT" on the whole project resource, so the only updateable field is "Description". Other field updates will be ignored. This method also updates Settings and Parameters, but this is not an atomic operation. If an error occurs, it will be returned to caller what was updated or not.

type ProjectsReferences

type ProjectsReferences struct {
	Count int                 `json:"count,omitempty" xml:"count"`
	Items []*ProjectReference `json:"project,omitempty"`
}

ProjectsReferences contains subprojects, if exists

type Properties

type Properties struct {

	// count
	Count int32 `json:"count,omitempty" xml:"count"`

	// href
	Href string `json:"href,omitempty" xml:"href"`

	// property
	Items []*Property `json:"property"`
}

Properties represents a collection of key/value properties for a resource

func NewProperties

func NewProperties(items ...*Property) *Properties

NewProperties returns an instance of Properties collection

func NewPropertiesEmpty

func NewPropertiesEmpty() *Properties

NewPropertiesEmpty returns an instance of Properties collection with no properties

func (*Properties) Add

func (p *Properties) Add(prop *Property)

Add a new property to this collection

func (*Properties) AddOrReplaceProperty

func (p *Properties) AddOrReplaceProperty(prop *Property)

AddOrReplaceProperty will update a property value if another property with the same name exists. It won't replace the Property struct within the Properties collection.

func (*Properties) AddOrReplaceValue

func (p *Properties) AddOrReplaceValue(n string, v string)

AddOrReplaceValue will update a property value if it exists, or add if it doesnt

func (*Properties) Concat

func (p *Properties) Concat(source *Properties) *Properties

Concat appends the source Properties collection to this collection and returns the appended collection

func (*Properties) GetOk

func (p *Properties) GetOk(key string) (string, bool)

GetOk returns the value of the propery and true if found, otherwise ""/false

func (*Properties) Map

func (p *Properties) Map() map[string]string

Map converts Properties to a key/value dictionary as map[string]string

func (*Properties) Remove

func (p *Properties) Remove(n string)

Remove a property if it exists in the collection

type Property

type Property struct {

	// inherited
	Inherited *bool `json:"inherited,omitempty" xml:"inherited"`

	// name
	Name string `json:"name,omitempty" xml:"name"`

	// type
	Type *Type `json:"type,omitempty"`

	// value
	Value string `json:"value" xml:"value"`
}

Property represents a key/value/type structure used by several resources to extend their representation

func NewProperty

func NewProperty(name string, value string) *Property

NewProperty returns an instance of Property

func (*Property) String

func (p *Property) String() string

type PropertyAssertions

type PropertyAssertions struct {
	// contains filtered or unexported fields
}

PropertyAssertions is a helper for tests that are defined in teamcity package. Not sure how to factor these out in a proper place.

type PullRequestsGithubOptions

type PullRequestsGithubOptions struct {
	//AuthenticationType can be 'password' or 'token'
	AuthenticationType string
	//Username is required if AuthenticationType is 'password'
	Username string
	//Password is required if AuthenticationType is 'password'
	Password string
	//AccessToken is required if AuthenticationType is 'token'
	AccessToken string
	// additional
	FilterAuthorRole   string
	FilterSourceBranch []string
	FilterTargetBranch []string
}

PullRequestsGithubOptions represents parameters used to create Github Commit Status Publisher Feature

func NewPullRequestsGithubOptionsPassword

func NewPullRequestsGithubOptionsPassword(username string, password string, filterAuthorRole string) PullRequestsGithubOptions

NewPullRequestsGithubOptionsPassword returns options created for AuthenticationType = 'password'. No validation is performed, parameters indicate mandatory fields.

func NewPullRequestsGithubOptionsToken

func NewPullRequestsGithubOptionsToken(accessToken string, filterAuthorRole string) PullRequestsGithubOptions

NewPullRequestsGithubOptionsToken returns options created for AuthenticationType = 'token'. No validation is performed, parameters indicate mandatory fields.

func PullRequestsGithubOptionsFromProperties

func PullRequestsGithubOptionsFromProperties(p *Properties) (*PullRequestsGithubOptions, error)

PullRequestsGithubOptionsFromProperties grabs a Properties collection and transforms back to a PullRequestsGithubOptions

func (PullRequestsGithubOptions) Properties

func (s PullRequestsGithubOptions) Properties() *Properties

Properties returns a *Properties collection with properties filled related to this commit publisher parameters to be used in build features

type RoleAssignmentReference

type RoleAssignmentReference struct {
	RoleID string `json:"roleId,omitempty" xml:"roleId"`
	Scope  string `json:"scope,omitempty" xml:"scope"`
	Href   string `json:"href,omitempty" xml:"href"`
}

RoleAssignmentReference represents a response of a request to assign role to a group or a user

type RoleAssignmentService

type RoleAssignmentService struct {
	// contains filtered or unexported fields
}

RoleAssignmentService has operations for handling role assignments for groups or users

func (*RoleAssignmentService) AssignToGroup

func (s *RoleAssignmentService) AssignToGroup(assignment *GroupRoleAssignment) (*RoleAssignmentReference, error)

AssignToGroup adds a role assignment to a group

func (*RoleAssignmentService) GetAllForGroup

func (s *RoleAssignmentService) GetAllForGroup(group *Group) ([]RoleAssignmentReference, error)

GetAllForGroup gets all the role assignments for a group

func (*RoleAssignmentService) GetForGroup

GetForGroup get a specific role assignment for a group

func (*RoleAssignmentService) UnassignFromGroup

func (s *RoleAssignmentService) UnassignFromGroup(assignment *GroupRoleAssignment) error

UnassignFromGroup removes the role assignment from a group

type Server

type Server struct {

	// build date
	BuildDate string `json:"buildDate,omitempty" xml:"buildDate"`

	// build number
	BuildNumber string `json:"buildNumber,omitempty" xml:"buildNumber"`

	// current time
	CurrentTime string `json:"currentTime,omitempty" xml:"currentTime"`

	// internal Id
	InternalID string `json:"internalId,omitempty" xml:"internalId"`

	// version
	Version string `json:"version,omitempty" xml:"version"`

	// version major
	VersionMajor int32 `json:"versionMajor,omitempty" xml:"versionMajor"`

	// version minor
	VersionMinor int32 `json:"versionMinor,omitempty" xml:"versionMinor"`

	// web Url
	WebURL string `json:"webUrl,omitempty" xml:"webUrl"`
}

Server holds information about the TeamCity server

type ServerService

type ServerService struct {
	// contains filtered or unexported fields
}

ServerService allows retrieving information about the server

func (*ServerService) Get

func (s *ServerService) Get() (*Server, error)

Get returns a struct with server information

type SnapshotDependencies

type SnapshotDependencies struct {
	// count
	Count int32 `json:"count,omitempty" xml:"count"`

	// property
	Items []*SnapshotDependency `json:"snapshot-dependency"`
}

SnapshotDependencies represents a collection of SnapshotDependency

type SnapshotDependency

type SnapshotDependency struct {

	// disabled - Read Only, no effect on post
	Disabled *bool `json:"disabled,omitempty" xml:"disabled"`

	// href
	Href string `json:"href,omitempty" xml:"href"`

	// id
	ID string `json:"id,omitempty" xml:"id"`

	// inherited
	Inherited *bool `json:"inherited,omitempty" xml:"inherited"`

	// Properties are serializable options for this snapshot dependency. Do not change this field directly, use the NewSnapshotDependency... constructors
	Properties *Properties `json:"properties,omitempty"`

	// source build type
	SourceBuildType *BuildTypeReference `json:"source-buildType,omitempty"`

	// Build type id this dependency belongs to
	BuildTypeID string `json:"-"`

	// type
	Type string `json:"type,omitempty" xml:"type"`
}

SnapshotDependency represents a single snapshot dependency for a build type

func NewSnapshotDependency

func NewSnapshotDependency(sourceBuildTypeID string) *SnapshotDependency

NewSnapshotDependency created a SnapshotDependency struct with default SnapshotDependencyOptions

func NewSnapshotDependencyWithOptions

func NewSnapshotDependencyWithOptions(sourceBuildTypeID string, opt *SnapshotDependencyOptions) *SnapshotDependency

NewSnapshotDependencyWithOptions creates a SnapshotDependency struct with the provided options

type SnapshotDependencyOptions

type SnapshotDependencyOptions struct {
	OnFailedDependency                  string
	OnFailedToStartOrCanceledDependency string
	RunSameAgent                        bool
	TakeSuccessfulBuildsOnly            bool
	DoNotRunNewBuildIfThereIsASuitable  bool
}

SnapshotDependencyOptions represents possible options for when creating a snapshot dependency

type SshAgentOptions

type SshAgentOptions struct {
	SshKey string
}

SshAgentOptions represents parameters used to create Github Commit Status Publisher Feature

func NewSshAgentOptions

func NewSshAgentOptions(sshKey string) SshAgentOptions

NewSshAgentOptions returns options created for AuthenticationType = 'token'. No validation is performed, parameters indicate mandatory fields.

func SshAgentOptionsFromProperties

func SshAgentOptionsFromProperties(p *Properties) (*SshAgentOptions, error)

SshAgentOptionsFromProperties grabs a Properties collection and transforms back to a SshAgentOptions

func (SshAgentOptions) Properties

func (s SshAgentOptions) Properties() *Properties

Properties returns a *Properties collection with properties filled related to this commit publisher parameters to be used in build features

type StatusPublisherGithubOptions

type StatusPublisherGithubOptions struct {
	//AuthenticationType can be 'password' or 'token'
	AuthenticationType string
	//Host is the Github URL, for instance "https://api.github.com" or "https://hostname/api/v3/" for Github Enterprise
	Host string
	//Username is required if AuthenticationType is 'password'
	Username string
	//Password is required if AuthenticationType is 'password'
	Password string
	//AccessToken is required if AuthenticationType is 'token'
	AccessToken string
}

StatusPublisherGithubOptions represents parameters used to create Github Commit Status Publisher Feature

func CommitStatusPublisherGithubOptionsFromProperties

func CommitStatusPublisherGithubOptionsFromProperties(p *Properties) (*StatusPublisherGithubOptions, error)

CommitStatusPublisherGithubOptionsFromProperties grabs a Properties collection and transforms back to a StatusPublisherGithubOptions

func NewCommitStatusPublisherGithubOptionsPassword

func NewCommitStatusPublisherGithubOptionsPassword(host string, username string, password string) StatusPublisherGithubOptions

NewCommitStatusPublisherGithubOptionsPassword returns options created for AuthenticationType = 'password'. No validation is performed, parameters indicate mandatory fields.

func NewCommitStatusPublisherGithubOptionsToken

func NewCommitStatusPublisherGithubOptionsToken(host string, accessToken string) StatusPublisherGithubOptions

NewCommitStatusPublisherGithubOptionsToken returns options created for AuthenticationType = 'token'. No validation is performed, parameters indicate mandatory fields.

func (StatusPublisherGithubOptions) Properties

func (s StatusPublisherGithubOptions) Properties() *Properties

Properties returns a *Properties collection with properties filled related to this commit publisher parameters to be used in build features

type Step

type Step interface {
	GetID() string
	GetName() string
	Type() string
	// contains filtered or unexported methods
}

Step interface represents a a build configuration/template build step. To interact with concrete step types, see the Step* types.

type StepCommandLine

type StepCommandLine struct {
	ID   string
	Name string

	//CustomScript contains code for platform specific script, like .cmd on windows or shell script on Unix-like environments.
	CustomScript string
	//CommandExecutable is the executable program to be called from this step.
	CommandExecutable string
	//CommandParameters are additional parameters to be passed on to the CommandExecutable.
	CommandParameters string
	//ExecuteMode is the execute mode for the step. See StepExecuteMode for details.
	ExecuteMode StepExecuteMode
	// Docker Image
	DockerImage string
	// Docker Image Platform
	DockerImagePlatform string
	// contains filtered or unexported fields
}

StepCommandLine represents a a build step of type "CommandLine"

func NewStepCommandLineExecutable

func NewStepCommandLineExecutable(name string, executable string, args string) (*StepCommandLine, error)

NewStepCommandLineExecutable creates a command line that invokes an external executable.

func NewStepCommandLineScript

func NewStepCommandLineScript(name string, script string, props map[string]string) (*StepCommandLine, error)

NewStepCommandLineScript creates a command line build step that runs an inline platform-specific script.

func (*StepCommandLine) GetID

func (s *StepCommandLine) GetID() string

GetID is a wrapper implementation for ID field, to comply with Step interface

func (*StepCommandLine) GetName

func (s *StepCommandLine) GetName() string

GetName is a wrapper implementation for Name field, to comply with Step interface

func (*StepCommandLine) MarshalJSON

func (s *StepCommandLine) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for StepCommandLine

func (*StepCommandLine) Type

func (s *StepCommandLine) Type() BuildStepType

Type returns the step type, in this case "StepTypeCommandLine".

func (*StepCommandLine) UnmarshalJSON

func (s *StepCommandLine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for StepCommandLine

type StepExecuteMode

type StepExecuteMode = string

StepExecuteMode represents how a build configuration step will execute regarding others.

type StepOctopusCreateRelease

type StepOctopusCreateRelease struct {
	ID   string
	Name string

	// Specify Octopus web portal URL.
	Host string

	// Specify Octopus API key.
	ApiKey string

	// Specify which version of the Octopus Deploy server you are using.
	OctopusServerVersion string

	// Name of the Octopus project to create a release for.
	Project string

	// Number to use for this release.
	ReleaseNumber string

	// Channel to create the release for.
	ChannelName string

	// Comma separated list of environments to deploy to.
	// Leave empty to create a release without deploying it.
	Environments string

	// Comma separated list of tenants to promote for.
	// Wildcard '*' will promote all tenants currently able to deploy to the above provided environment.
	// Note that when supplying tenant filters then only one environment may be provided above.
	Tenants string

	// Comma separated list of tenant tags that match tenants to deploy for.
	// Note that when supplying tag filters then only one environment may be provided above.
	TenantTags string

	//  If true, the build process will only succeed if the deployment is successful.
	// Output from the deployment will appear in the build output.
	WaitForDeployments bool

	// Additional arguments to be passed to Octo.exe.
	AdditionalCommandLineArguments string
	// contains filtered or unexported fields
}

StepOctopusPushPackage represents a a build step of type "octopus.create.release"

func NewStepOctopusCreateRelease

func NewStepOctopusCreateRelease(name string) (*StepOctopusCreateRelease, error)

func (*StepOctopusCreateRelease) GetID

func (s *StepOctopusCreateRelease) GetID() string

func (*StepOctopusCreateRelease) GetName

func (s *StepOctopusCreateRelease) GetName() string

func (*StepOctopusCreateRelease) MarshalJSON

func (s *StepOctopusCreateRelease) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for StepOctopusCreateRelease

func (*StepOctopusCreateRelease) Type

func (*StepOctopusCreateRelease) UnmarshalJSON

func (s *StepOctopusCreateRelease) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for StepOctopusPushPackage

type StepOctopusPushPackage

type StepOctopusPushPackage struct {
	ID   string
	Name string

	// Specify Octopus web portal URL.
	Host string

	// Specify Octopus API key.
	ApiKey string

	// Specify  Package path patterns.
	PackagePaths string

	// Force overwrite existing packages.
	ForcePush bool

	// Automatically publish any packages as TeamCity build artifacts.
	PublishArtifacts bool

	// Additional arguments to be passed to Octo.exe.
	AdditionalCommandLineArguments string
	// contains filtered or unexported fields
}

StepOctopusPushPackage represents a a build step of type "octopus.push.package"

func NewStepOctopusPushPackage

func NewStepOctopusPushPackage(name string) (*StepOctopusPushPackage, error)

func (*StepOctopusPushPackage) GetID

func (s *StepOctopusPushPackage) GetID() string

func (*StepOctopusPushPackage) GetName

func (s *StepOctopusPushPackage) GetName() string

func (*StepOctopusPushPackage) MarshalJSON

func (s *StepOctopusPushPackage) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for StepOctopusPushPackage

func (*StepOctopusPushPackage) Type

func (*StepOctopusPushPackage) UnmarshalJSON

func (s *StepOctopusPushPackage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for StepOctopusPushPackage

type StepPowershell

type StepPowershell struct {
	ID   string
	Name string

	//ScriptFile holds the name of script to run for this step.
	ScriptFile string
	//Code is the inline powershell code to be ran for this step.
	Code string
	//ScriptArgs are the arguments that will be passed when using "ScriptFile"
	ScriptArgs string
	//ExecuteMode is the execute mode for the step. See StepExecuteMode for details.
	ExecuteMode StepExecuteMode
	// contains filtered or unexported fields
}

StepPowershell represents a a build step of type "Powershell"

func NewStepPowershellCode

func NewStepPowershellCode(name string, code string) (*StepPowershell, error)

NewStepPowershellCode creates a powershell build step that runs the inline code.

func NewStepPowershellScriptFile

func NewStepPowershellScriptFile(name string, scriptFile string, scriptArgs string) (*StepPowershell, error)

NewStepPowershellScriptFile creates a powershell build step that runs a script file instead of inline code.

func (*StepPowershell) GetID

func (s *StepPowershell) GetID() string

GetID is a wrapper implementation for ID field, to comply with Step interface

func (*StepPowershell) GetName

func (s *StepPowershell) GetName() string

GetName is a wrapper implementation for Name field, to comply with Step interface

func (*StepPowershell) MarshalJSON

func (s *StepPowershell) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for StepPowershell

func (*StepPowershell) Type

func (s *StepPowershell) Type() BuildStepType

Type returns the step type, in this case "StepTypePowershell".

func (*StepPowershell) UnmarshalJSON

func (s *StepPowershell) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for StepPowershell

type Templates

type Templates struct {

	// count
	Count int32 `json:"count,omitempty" xml:"count"`

	// buildType
	Items []*BuildTypeReference `json:"buildType"`
}

Templates represents a collection of BuildTypeReference that are templates attached to a build configuration.

type Trigger

type Trigger interface {
	ID() string
	Type() string
	Disabled() bool
	SetBuildTypeID(buildTypeID string)
	BuildTypeID() string
}

Trigger represents a build trigger to be associated with a build configuration. Use the constructor methods to create new instances.

type TriggerBuildFinish

type TriggerBuildFinish struct {
	SourceBuildID string
	Options       *TriggerBuildFinishOptions
	// contains filtered or unexported fields
}

TriggerBuildFinish represents a build trigger that fires when the given build ID to is finished

func NewTriggerBuildFinish

func NewTriggerBuildFinish(sourceBuildID string, opt *TriggerBuildFinishOptions) (*TriggerBuildFinish, error)

NewTriggerBuildFinish returns a finish build trigger type with TriggerVcsOptions.

func (*TriggerBuildFinish) BuildTypeID

func (t *TriggerBuildFinish) BuildTypeID() string

BuildTypeID gets the build type identifier

func (*TriggerBuildFinish) Disabled

func (t *TriggerBuildFinish) Disabled() bool

Disabled gets the disabled status for this trigger

func (*TriggerBuildFinish) ID

func (t *TriggerBuildFinish) ID() string

ID for this entity

func (*TriggerBuildFinish) MarshalJSON

func (t *TriggerBuildFinish) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for TriggerVcs

func (*TriggerBuildFinish) SetBuildTypeID

func (t *TriggerBuildFinish) SetBuildTypeID(id string)

SetBuildTypeID sets the build type identifier

func (*TriggerBuildFinish) SetDisabled

func (t *TriggerBuildFinish) SetDisabled(disabled bool)

SetDisabled controls whether this trigger is disabled or not

func (*TriggerBuildFinish) Type

func (t *TriggerBuildFinish) Type() string

Type returns TriggerTypes.BuildFinish ("buildDependencyTrigger")

func (*TriggerBuildFinish) UnmarshalJSON

func (t *TriggerBuildFinish) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for TriggerBuildFinish

type TriggerBuildFinishOptions

type TriggerBuildFinishOptions struct {
	AfterSuccessfulBuildOnly bool     `prop:"afterSucessfulBuildOnly"`
	BranchFilter             []string `prop:"branchFilter" separator:"\n"`
}

TriggerBuildFinishOptions represents optional settings for a 'Finish Build' Trigger type.

func NewTriggerBuildFinishOptions

func NewTriggerBuildFinishOptions(afterSuccessfulBuildOnly bool, branchFilter []string) *TriggerBuildFinishOptions

NewTriggerBuildFinishOptions initialize a NewTriggerBuildFinishOptions branchFilter can be passed as "nil" to not filter on any specific branches

type TriggerSchedule

type TriggerSchedule struct {
	SchedulingPolicy TriggerSchedulingPolicy `prop:"schedulingPolicy"`
	Rules            []string                `prop:"triggerRules" separator:"\n"`
	Timezone         string                  `prop:"timezone"`
	Hour             uint                    `prop:"hour"`
	Minute           uint                    `prop:"minute"`
	Weekday          time.Weekday
	Options          *TriggerScheduleOptions
	// contains filtered or unexported fields
}

TriggerSchedule represents a build trigger that fires on a time-bound schedule

func NewTriggerSchedule

func NewTriggerSchedule(schedulingPolicy TriggerSchedulingPolicy, sourceBuildID string, weekday time.Weekday, hour uint, minute uint, timezone string, rules []string, opt *TriggerScheduleOptions) (*TriggerSchedule, error)

NewTriggerSchedule returns a TriggerSchedule with the scheduling policy and options specified

func NewTriggerScheduleDaily

func NewTriggerScheduleDaily(sourceBuildID string, hour uint, minute uint, timezone string, rules []string) (*TriggerSchedule, error)

NewTriggerScheduleDaily returns a TriggerSchedule that fires daily on the hour/minute specified

func NewTriggerScheduleWeekly

func NewTriggerScheduleWeekly(sourceBuildID string, weekday time.Weekday, hour uint, minute uint, timezone string, rules []string) (*TriggerSchedule, error)

NewTriggerScheduleWeekly returns a TriggerSchedule that fires weekly on the weekday and hour/minute specified

func (*TriggerSchedule) BuildTypeID

func (t *TriggerSchedule) BuildTypeID() string

BuildTypeID gets the build type identifier

func (*TriggerSchedule) Disabled

func (t *TriggerSchedule) Disabled() bool

Disabled gets the disabled status for this trigger

func (*TriggerSchedule) ID

func (t *TriggerSchedule) ID() string

ID for this entity

func (*TriggerSchedule) MarshalJSON

func (t *TriggerSchedule) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for TriggerSchedule

func (*TriggerSchedule) SetBuildTypeID

func (t *TriggerSchedule) SetBuildTypeID(id string)

SetBuildTypeID sets the build type identifier

func (*TriggerSchedule) SetDisabled

func (t *TriggerSchedule) SetDisabled(disabled bool)

SetDisabled controls whether this trigger is disabled or not

func (*TriggerSchedule) Type

func (t *TriggerSchedule) Type() string

Type returns TriggerTypes.Schedule ("schedulingTrigger")

func (*TriggerSchedule) UnmarshalJSON

func (t *TriggerSchedule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for TriggerSchedule

type TriggerScheduleOptions

type TriggerScheduleOptions struct {
	QueueOptimization                   bool                       `prop:"enableQueueOptimization" force:""`
	PromoteWatchedBuild                 bool                       `prop:"promoteWatchedBuild" force:""`
	BuildWithPendingChangesOnly         bool                       `prop:"triggerBuildWithPendingChangesOnly" force:""`
	TriggerIfWatchedBuildChanges        bool                       `prop:"triggerBuildIfWatchedBuildChanges"`
	BuildOnAllCompatibleAgents          bool                       `prop:"triggerBuildOnAllCompatibleAgents"`
	RevisionRuleSourceBuildID           string                     `prop:"revisionRuleDependsOn"`
	RevisionRule                        ArtifactDependencyRevision `prop:"revisionRule"`
	RevisionRuleBuildBranch             string                     `prop:"revisionRuleBuildBranch"`
	EnforceCleanCheckout                bool                       `prop:"enforceCleanCheckout"`
	EnforceCleanCheckoutForDependencies bool                       `prop:"enforceCleanCheckoutForDependencies"`
}

TriggerScheduleOptions represent options for configuring a scheduled build trigger

func NewTriggerScheduleOptions

func NewTriggerScheduleOptions() *TriggerScheduleOptions

NewTriggerScheduleOptions returns a TriggerScheduleOptions with default values

type TriggerSchedulingPolicy

type TriggerSchedulingPolicy = string

TriggerSchedulingPolicy represents the shceduling policy for a scheduled trigger. Can be 'daily', 'weekly' or 'cron'

const (
	//TriggerSchedulingDaily triggers every day
	TriggerSchedulingDaily TriggerSchedulingPolicy = "daily"
	//TriggerSchedulingWeekly triggers at specified day + time of the week, once per week
	TriggerSchedulingWeekly TriggerSchedulingPolicy = "weekly"
	//TriggerSchedulingCron triggers by matching a cron expression
	TriggerSchedulingCron TriggerSchedulingPolicy = "cron"
)

type TriggerService

type TriggerService struct {
	BuildTypeID string
	// contains filtered or unexported fields
}

TriggerService provides operations for managing build triggers for a buildType

func (*TriggerService) AddTrigger

func (s *TriggerService) AddTrigger(t Trigger) (Trigger, error)

AddTrigger adds a new build trigger to a build type

func (*TriggerService) Delete

func (s *TriggerService) Delete(id string) error

Delete removes a build trigger from the build configuration by its id

func (*TriggerService) GetByID

func (s *TriggerService) GetByID(id string) (Trigger, error)

GetByID returns a build trigger by its id

type TriggerVcs

type TriggerVcs struct {
	BranchFilter []string
	Rules        []string
	Options      *TriggerVcsOptions
	// contains filtered or unexported fields
}

TriggerVcs represents a build trigger on VCS changes

func NewTriggerVcs

func NewTriggerVcs(triggerRules []string, branchFilter []string) (*TriggerVcs, error)

NewTriggerVcs returns a VCS trigger type with the triggerRules specified. triggerRules is required, but branchFilter can be optional if the VCS root uses multiple branches.

func NewTriggerVcsWithOptions

func NewTriggerVcsWithOptions(triggerRules []string, branchFilter []string, opt *TriggerVcsOptions) (*TriggerVcs, error)

NewTriggerVcsWithOptions returns a VCS trigger type with TriggerVcsOptions. See also NewTriggerVcs for other parameters.

func (*TriggerVcs) BuildTypeID

func (t *TriggerVcs) BuildTypeID() string

BuildTypeID gets the build type identifier

func (*TriggerVcs) Disabled

func (t *TriggerVcs) Disabled() bool

Disabled gets the disabled status for this trigger

func (*TriggerVcs) ID

func (t *TriggerVcs) ID() string

ID for this entity

func (*TriggerVcs) MarshalJSON

func (t *TriggerVcs) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON serialization for TriggerVcs

func (*TriggerVcs) SetBuildTypeID

func (t *TriggerVcs) SetBuildTypeID(id string)

SetBuildTypeID sets the build type identifier

func (*TriggerVcs) SetDisabled

func (t *TriggerVcs) SetDisabled(disabled bool)

SetDisabled controls whether this trigger is disabled or not

func (*TriggerVcs) Type

func (t *TriggerVcs) Type() string

Type returns TriggerTypes.Vcs ("vcsTrigger")

func (*TriggerVcs) UnmarshalJSON

func (t *TriggerVcs) UnmarshalJSON(data []byte) error

UnmarshalJSON implements JSON deserialization for TriggerVcs

type TriggerVcsOptions

type TriggerVcsOptions struct {
	GroupUserCheckins    bool
	QuietPeriodMode      VcsTriggerQuietPeriodMode
	QuietPeriodInSeconds int
	// contains filtered or unexported fields
}

TriggerVcsOptions represents optional settings for a VCS Trigger type.

func NewTriggerVcsOptions

func NewTriggerVcsOptions(mode VcsTriggerQuietPeriodMode, seconds int) (*TriggerVcsOptions, error)

NewTriggerVcsOptions initialize a TriggerVcsOptions instance with same defaults as TeamCity UI

Defaults:

  • GroupCheckins = false
  • EnableQueueOptimization = false

func (*TriggerVcsOptions) PerCheckinTriggering

func (o *TriggerVcsOptions) PerCheckinTriggering() bool

PerCheckinTriggering gets the value of perCheckinTriggering property

func (*TriggerVcsOptions) QueueOptimization

func (o *TriggerVcsOptions) QueueOptimization() bool

QueueOptimization gets the value of enableQueueOptimization property

func (*TriggerVcsOptions) SetPerCheckinTriggering

func (o *TriggerVcsOptions) SetPerCheckinTriggering(enable bool)

SetPerCheckinTriggering specifies if VCS Trigger will fire a different build per checkin or commit for different committers. If set to true, enableQueueOptimization will be disabled.

func (*TriggerVcsOptions) SetQueueOptimization

func (o *TriggerVcsOptions) SetQueueOptimization(enable bool)

SetQueueOptimization toggles allowing the server to replace an already started build or a more recently queued one if new changes are detected. If set to true, PerCheckinTriggering will be disabled.

type Triggers

type Triggers struct {
	// count
	Count int32 `json:"count,omitempty" xml:"count"`

	// property
	Items []*Trigger `json:"trigger"`
}

Triggers represents a typed, serializable collection of Trigger

type Type

type Type struct {
	// raw value
	RawValue string `json:"rawValue,omitempty" xml:"rawValue"`
}

Type represents a parameter type . The rawValue is the parameter specification as defined in the UI.

type VcsRoot

type VcsRoot interface {
	//GetID returns the ID of this VCS Root
	GetID() string

	//VcsName returns the type of VCS Root. See VcsNames for possible values returned.
	//In addition, this can be used to type assert to the appropriate concrete VCS Root type.
	VcsName() string

	//Name returns the name of VCS Root.
	Name() string

	//SetName changes the name of VCSRoot.
	SetName(name string)

	//ModificationCheckInterval returns how often TeamCity polls the VCS repository for VCS changes, in seconds. Returns an *int32 pointer as this is an optional settings.
	//If the return is nil, means that the VCS Root follows the global server setting.
	ModificationCheckInterval() *int32

	//SetModificationCheckInterval specifies how often TeamCity polls the VCS repository for VCS changes, in seconds.
	SetModificationCheckInterval(seconds int32)

	//ProjectID returns the projectID where this VCS Root is defined
	ProjectID() string

	//SetProjectID specifies the project for this VCS Root. When moving VCS Roots between projects, it must not be in use by any other build configurations or sub-projects.
	SetProjectID(id string)

	//Properties returns the Properties collection for this VCS Root. This should be used for querying only.
	Properties() *Properties
}

VcsRoot interface represents a base type of VCSRoot

type VcsRootEntries

type VcsRootEntries struct {
	// count
	Count int32 `json:"count,omitempty" xml:"count"`

	// href
	Href string `json:"href,omitempty" xml:"href"`

	// property
	Items []*VcsRootEntry `json:"vcs-root-entry"`
}

VcsRootEntries represents a collection of VCS Roots attached to a resource

func NewVcsRootEntries

func NewVcsRootEntries(items ...*VcsRootReference) *VcsRootEntries

NewVcsRootEntries returns an instance of VcsRootEntries collection

type VcsRootEntry

type VcsRootEntry struct {
	// id
	ID string `json:"id,omitempty" xmld:"id"`

	// inherited
	Inherited *bool `json:"inherited,omitempty" xml:"inherited"`

	// checkout rules
	CheckoutRules string `json:"checkout-rules,omitempty"`

	// vcs root
	VcsRoot *VcsRootReference `json:"vcs-root,omitempty"`
}

VcsRootEntry represents a single VCS Root attached to a resource

func NewVcsRootEntry

func NewVcsRootEntry(vcsRef *VcsRootReference) *VcsRootEntry

NewVcsRootEntry is a convenience function for attaching a VcsRootReference to a Build configuration, represented as a VcsRootEntry in Teamcity API

func NewVcsRootEntryWithRules

func NewVcsRootEntryWithRules(vcsRef *VcsRootReference, checkoutRules string) *VcsRootEntry

NewVcsRootEntryWithRules is a convenience function for attaching a VcsRootReference to a Build configuration, represented as a VcsRootEntry in Teamcity API

type VcsRootReference

type VcsRootReference struct {

	// href
	Href string `json:"href,omitempty" xml:"href"`

	// id
	ID string `json:"id,omitempty" xml:"id"`

	// name
	Name string `json:"name,omitempty" xml:"name"`

	// project Id
	Project *ProjectReference `json:"project,omitempty" xml:"project"`
}

VcsRootReference represents a subset detail of a VCS Root

type VcsRootService

type VcsRootService struct {
	// contains filtered or unexported fields
}

VcsRootService has operations for handling vcs roots

func (*VcsRootService) Create

func (s *VcsRootService) Create(projectID string, vcsRoot VcsRoot) (*VcsRootReference, error)

Create creates a new vcs root

func (*VcsRootService) Delete

func (s *VcsRootService) Delete(id string) error

Delete a VCS Root resource using id: locator

func (*VcsRootService) GetByID

func (s *VcsRootService) GetByID(id string) (VcsRoot, error)

GetByID Retrieves a vcs root by id using the id: locator

func (*VcsRootService) Update

func (s *VcsRootService) Update(vcsRoot VcsRoot) (VcsRoot, error)

Update changes the resource in-place for a VCS Root. TeamCity API does not support "PUT" on the whole VCS Root resource. Updateable fields are "name", "project" and "modificationCheckInterval". This method also updates Settings and Parameters, but this is not an atomic operation. If an error occurs, it will be returned to caller what was updated or not.

type VcsTriggerQuietPeriodMode

type VcsTriggerQuietPeriodMode int

VcsTriggerQuietPeriodMode specifies if the VCS Trigger will delay the start of a build after detecting a VCS change, used by TriggerVcsOptions.

const (
	// QuietPeriodDoNotUse disables QuietPeriod on VCS Trigger
	QuietPeriodDoNotUse VcsTriggerQuietPeriodMode = 0
	// QuietPeriodUseDefault instructs the VCS Trigger to respect the server-wide quiet period
	QuietPeriodUseDefault VcsTriggerQuietPeriodMode = 1
	// QuietPeriodCustom allows specifying a period in seconds via TriggerVcsOptions.QuietPeriodInSeconds. When using Custom, TriggerVcsOptions.QuietPeriodInSeconds is mandatory.
	QuietPeriodCustom VcsTriggerQuietPeriodMode = 2
)

type VersionedSettingsBuildSettings

type VersionedSettingsBuildSettings string

VersionedSettingsBuildSettings represents the supported strategies for retrieving the current settings.

const (
	// VersionedSettingsBuildSettingsPreferCurrent determines that teamcity will default to the settings from the teamcity server.
	VersionedSettingsBuildSettingsPreferCurrent VersionedSettingsBuildSettings = "PREFER_CURRENT"
	// VersionedSettingsBuildSettingsPreferVcs determines that teamcity should always prefer the settings stored in the VCS.
	VersionedSettingsBuildSettingsPreferVcs VersionedSettingsBuildSettings = "PREFER_VCS"
	// VersionedSettingsBuildSettingsAlwaysUseCurrent determines that teamcity should always use the project settings from the server.
	VersionedSettingsBuildSettingsAlwaysUseCurrent VersionedSettingsBuildSettings = "ALWAYS_USE_CURRENT"
)

type VersionedSettingsFormat

type VersionedSettingsFormat string

VersionedSettingsFormat represents the supported formats for the versioned settings project feature.

const (
	// VersionedSettingsFormatKotlin represents that the versioned settings are stored as kotlin files.
	VersionedSettingsFormatKotlin VersionedSettingsFormat = "kotlin"
	// VersionedSettingsFormatXML represents that the versioned settings are stored as xml files.
	VersionedSettingsFormatXML VersionedSettingsFormat = "xml"
)

Jump to

Keyboard shortcuts

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