Documentation
¶
Index ¶
- Constants
- type AzureDevOps
- func (a *AzureDevOps) Add(files []string) error
- func (a *AzureDevOps) Checkout() error
- func (a *AzureDevOps) Clean() error
- func (a *AzureDevOps) CleanWorkingBranch() (bool, error)
- func (a *AzureDevOps) Clone() (string, error)
- func (a *AzureDevOps) Commit(ctx context.Context, message string) error
- func (a *AzureDevOps) GetBranches() (sourceBranch, workingBranch, targetBranch string)
- func (a *AzureDevOps) GetChangedFiles(workingDir string) ([]string, error)
- func (a *AzureDevOps) GetDirectory() (directory string)
- func (a *AzureDevOps) GetURL() string
- func (a *AzureDevOps) IsRemoteBranchUpToDate() (bool, error)
- func (a *AzureDevOps) IsRemoteWorkingBranchExist() (bool, error)
- func (a *AzureDevOps) Push() (bool, error)
- func (a *AzureDevOps) PushBranch(branch string) error
- func (a *AzureDevOps) PushTag(tag string) error
- func (a *AzureDevOps) Summary() string
- type Spec
Constants ¶
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) 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) 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) PushBranch ¶
func (a *AzureDevOps) PushBranch(branch string) error
PushBranch pushes branches.
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.