azuredevops

package
v0.117.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Kind defines the SCM kind for Azure DevOps.
	Kind = "azuredevops"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureDevOps

type AzureDevOps struct {
	Spec Spec
	// contains filtered or unexported fields
}

AzureDevOps contains settings to interact with Azure DevOps.

func New

func New(spec interface{}, pipelineID string) (*AzureDevOps, error)

New returns a new valid Azure DevOps object.

func (*AzureDevOps) Add

func (a *AzureDevOps) Add(files []string) error

Add runs `git add`.

func (*AzureDevOps) Checkout

func (a *AzureDevOps) Checkout() error

Checkout creates and then uses a temporary git branch.

func (*AzureDevOps) Clean

func (a *AzureDevOps) Clean() error

Clean deletes the local working directory.

func (*AzureDevOps) CleanWorkingBranch

func (a *AzureDevOps) CleanWorkingBranch() (bool, error)

CleanWorkingBranch checks if the working branch is diverged from the target branch and removes it if not.

func (*AzureDevOps) Clone

func (a *AzureDevOps) Clone() (string, error)

Clone runs `git clone`.

func (*AzureDevOps) Commit

func (a *AzureDevOps) Commit(ctx context.Context, message string) error

Commit runs `git commit`.

func (*AzureDevOps) GetBranches

func (a *AzureDevOps) GetBranches() (sourceBranch, workingBranch, targetBranch string)

GetBranches returns the source, working and target branches.

func (*AzureDevOps) GetChangedFiles

func (a *AzureDevOps) GetChangedFiles(workingDir string) ([]string, error)

GetChangedFiles returns a list of changed files.

func (*AzureDevOps) GetDirectory

func (a *AzureDevOps) GetDirectory() (directory string)

GetDirectory returns the local git repository path.

func (*AzureDevOps) GetURL

func (a *AzureDevOps) GetURL() string

GetURL returns an Azure DevOps git URL.

func (*AzureDevOps) IsRemoteBranchUpToDate

func (a *AzureDevOps) IsRemoteBranchUpToDate() (bool, error)

IsRemoteBranchUpToDate checks if the local working branch is up to date with the remote branch.

func (*AzureDevOps) IsRemoteWorkingBranchExist

func (a *AzureDevOps) IsRemoteWorkingBranchExist() (bool, error)

IsRemoteWorkingBranchExist checks if the remote working branch exists.

func (*AzureDevOps) Push

func (a *AzureDevOps) Push() (bool, error)

Push runs `git push`.

func (*AzureDevOps) PushBranch

func (a *AzureDevOps) PushBranch(branch string) error

PushBranch pushes branches.

func (*AzureDevOps) PushTag

func (a *AzureDevOps) PushTag(tag string) error

PushTag pushes tags.

func (*AzureDevOps) Summary

func (a *AzureDevOps) Summary() string

Summary returns a brief description of the Azure DevOps SCM configuration.

type Spec

type Spec struct {
	azdoclient.Spec `yaml:",inline,omitempty"`
	// "commitMessage" is used to generate the final commit message.
	CommitMessage commit.Commit `yaml:",omitempty"`
	// "directory" defines the local path where the git repository is cloned.
	Directory string `yaml:",omitempty"`
	// Depth defines the depth used when cloning the git repository.
	Depth *int `yaml:",omitempty"`
	// "email" defines the email used to commit changes.
	Email string `yaml:",omitempty"`
	// "force" is used during the git push phase to run `git push --force`.
	Force *bool `yaml:",omitempty"`
	// "gpg" specifies the GPG key and passphrased used for commit signing.
	GPG sign.GPGSpec `yaml:",omitempty"`
	// "user" specifies the user associated with new git commit messages created by Updatecli.
	User string `yaml:",omitempty"`
	// "branch" defines the git branch to work on.
	Branch string `yaml:",omitempty"`
	// WorkingBranchPrefix defines the prefix used to create a working branch.
	WorkingBranchPrefix *string `yaml:",omitempty"`
	// WorkingBranchSeparator defines the separator used to create a working branch.
	WorkingBranchSeparator *string `yaml:",omitempty"`
	// "submodules" defines if Updatecli should checkout submodules.
	Submodules *bool `yaml:",omitempty"`
	// "workingBranch" defines if Updatecli should use a temporary branch to work on.
	WorkingBranch *bool `yaml:",omitempty"`
}

Spec defines settings used to interact with Azure DevOps Git repositories.

func (*Spec) Validate

func (s *Spec) Validate() error

Jump to

Keyboard shortcuts

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