vcs

package
v0.3.10-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClonedPath

func GetClonedPath(input, folderName string, overwrite bool) string

GetClonedPath takes input and folder name performs clone with the appropriate VCS and then return the file system and remote paths

func IsRemotePath

func IsRemotePath(input string) bool

IsRemotePath returns if the provided input is a remote path or not

func PushVCSRepo

func PushVCSRepo(remotePath, folderName string) error

PushVCSRepo commits and pushes the changes in the provide vcs remote path

Types

type FailedVCSPush

type FailedVCSPush struct {
	VCSPath string
	Err     error
}

FailedVCSPush is the error when push is failed

func (*FailedVCSPush) Error

func (e *FailedVCSPush) Error() string

Error returns the error message for failed push

type GitVCSRepo

type GitVCSRepo struct {
	InputURL       string
	URL            string
	Branch         string
	Tag            string
	CommitHash     string
	PathWithinRepo string
	GitRepository  *git.Repository
	GitRepoPath    string
}

GitVCSRepo stores git repo config

func (*GitVCSRepo) Clone

func (gvcsrepo *GitVCSRepo) Clone(gitCloneOptions VCSCloneOptions) (string, error)

Clone Clones a git repository with the given commit depth and path where to be cloned and returns final path

type NoCompatibleVCSFound

type NoCompatibleVCSFound struct {
	URLInput string
}

NoCompatibleVCSFound is the error when no VCS is found suitable for the given remote input path

func (*NoCompatibleVCSFound) Error

func (e *NoCompatibleVCSFound) Error() string

Error returns the error message for no valid vcs is found

type VCS

type VCS interface {
	Clone(VCSCloneOptions) (string, error)
}

VCS defines interface for version control system

func GetVCSRepo

func GetVCSRepo(vcsurl string) (VCS, error)

GetVCSRepo extracts information from the given vcsurl and returns a relevant vcs repo struct

type VCSCloneOptions

type VCSCloneOptions struct {
	CommitDepth          int
	CloneDestinationPath string
	Overwrite            bool
}

VCSCloneOptions stores version control system clone options

Jump to

Keyboard shortcuts

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