azdo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AzDOBuildDetectionDoc = "If AzDO env variables SYSTEM_COLLECTIONURI, SYSTEM_TEAMPROJECT, and BUILD_BUILDID are set, includes a link to the build.\n"

AzDOBuildDetectionDoc describes how AzDO build detection works, listing the env vars used. Use this in the command description when using GetEnvBuildID or GetEnvBuildURL.

Variables

This section is empty.

Functions

func GetBuildURL

func GetBuildURL(collection, project, id string) string

func GetBuildWebURL

func GetBuildWebURL(b *build.Build) (string, bool)

GetBuildWebURL finds the web/UI URL (not API endpoint URL) in the given AzDO Build, if it exists.

func GetEnvAgentJobStatus

func GetEnvAgentJobStatus() string

GetEnvAgentJobStatus probes the environment to figure out the status of the current job, if this is running in an AzDO pipeline build.

func GetEnvBuildID

func GetEnvBuildID() string

GetEnvBuildID probes the environment to figure out the build ID, if this is running in an AzDO pipeline build.

func GetEnvBuildURL

func GetEnvBuildURL() string

GetEnvBuildURL probes the environment to figure out the build URL, if this is running in an AzDO pipeline build.

func GetEnvCollectionURI

func GetEnvCollectionURI() string

GetEnvCollectionURI probes the environment to figure out the collection URI, if this is running in an AzDO pipeline build.

func GetEnvDefinitionName

func GetEnvDefinitionName() string

GetEnvDefinitionName probes the environment to figure out the build definition (pipeline) name, if this is running in an AzDO pipeline build.

func GetEnvProject

func GetEnvProject() string

GetEnvProject probes the environment to figure out the AzDO project, if this is running in an AzDO pipeline build.

func LogCmdPrependPath

func LogCmdPrependPath(path string)

LogCmdPrependPath uses an AzDO logging command to prepend a path to future steps' PATH env vars. https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#prependpath-prepend-a-path-to-the--path-environment-variable

func LogCmdSetVariable

func LogCmdSetVariable(name, value string)

LogCmdSetVariable uses an AzDO logging command to set a variable in the current (build) context. https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#setvariable-initialize-or-modify-the-value-of-a-variable

func LogCmdUploadSummary

func LogCmdUploadSummary(path string)

LogCmdUploadSummary uses an AzDO logging command to upload a summary file. The file is shown on the build page in an "Extensions" tab. If it is a Markdown file, it is rendered with a subset of Markdown features. The path must be a full path. https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#uploadsummary-add-some-markdown-content-to-the-build-summary

Types

type ClientFlags

type ClientFlags struct {
	// Org is the base URL of the organization, such as 'https://dev.azure.com/dnceng/'
	Org *string
	// Proj is the project, such as 'public' or 'internal'.
	Proj *string
	// PAT is the Personal Access Token to use.
	PAT *string
}

ClientFlags is a set of command-line flags always used in go-infra to access the AzDO APIs.

func BindClientFlags

func BindClientFlags() *ClientFlags

BindClientFlags creates a ClientFlags struct where each field is set up as a flag.

func (*ClientFlags) EnsureAssigned

func (c *ClientFlags) EnsureAssigned() error

EnsureAssigned can be called after "flag.Parse()" to ensure all required flags were specified.

func (*ClientFlags) NewConnection

func (c *ClientFlags) NewConnection() *azuredevops.Connection

NewConnection creates an AzDO connection based on the given flags.

Jump to

Keyboard shortcuts

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