repo

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRepo added in v0.2.2

func CheckRepo()

func Checkprotocol added in v0.1.3

func Checkprotocol(v config.Repo) string

Checkprotocol checks protocol

func CloneOnNotExist

func CloneOnNotExist(repo config.Repo) error

CloneOnNotExist clone repo not exist locally

func GetRepoName

func GetRepoName(repo config.Repo) string

GetRepoName returns reponame.

func GetRepoOriginalName added in v0.3.0

func GetRepoOriginalName(repo config.Repo) string

GetRepoOriginal returns reponame withoutgit.

func IsDuplcatedRepo

func IsDuplcatedRepo(repos []config.Repo) (bool, error)

IsDuplcatedRepo check if repo is dupl in config.

func LocalRepoAddr

func LocalRepoAddr(repo config.Repo) string

LocalRepoAddr returns path repo storage in.

func Pull

func Pull(dst string, opts ...PullOptions) error

Pull pulls updates for the repository.

func RunScript

func RunScript(repo config.Repo) (int64, string, error)

Runscript run script inside repo dir.

func SearchRepo

func SearchRepo(ID string) (config.Repo, error)

Searchinfo returns repo with specified id.

func SetBuildStat added in v0.3.0

func SetBuildStat(id string, stat int)

SetBuildStat modify build status of repo.

func StartPullAndWorkflow added in v0.2.2

func StartPullAndWorkflow(repo config.Repo, hook Hook, action string)

Types

type CloneOptions

type CloneOptions struct {
	//hook type
	Type string
	//specify protocol
	Protocol string
	// Indicates whether the repository should be cloned as a mirror.
	Mirror bool
	// sshkey used for clone.
	Sshkey string
	// Indicates whether the repository should be cloned in bare format.
	Bare bool
	// Indicates whether to suppress the log output.
	Quiet bool
	// The branch to check out for the working tree when Bare=false.
	Branch string
	//Under http protocol
	Username string
	Password string
	//token (github)
	Token string
	// The number of revisions to clone.
	Depth uint64
	// The timeout duration before giving up for each shell command execution. The
	// default timeout duration will be used when not supplied.
	Timeout time.Duration
}

Gogs code under mit.

type Hook added in v0.2.2

type Hook struct {
	// branch
	Ref string
	//Before refers to hash before push.
	Before string
	//After refers to hash after push.
	After  string
	Pusher Pusher
}

type PullOptions

type PullOptions struct {
	//specify protocol
	Protocol string
	// Indicates whether to rebased during pulling.
	Rebase bool
	// Git rep
	Type string
	// sshkey used for clone.
	Sshkey string
	// Under http protocol
	Username string
	Password string
	// Auth type
	Token string
	// Indicates whether to pull from all remotes.
	All bool
	// The remote to pull updates from when All=false.
	Remote string
	// The branch to pull updates from when All=false and Remote is supplied.
	Branch string
	// The timeout duration before giving up for each shell command execution. The
	// default timeout duration will be used when not supplied.
	Timeout time.Duration
}

type Pusher added in v0.2.2

type Pusher struct {
	//Github
	Name string
	//Gogs
	Username string
}

type UncriticalError

type UncriticalError struct {
	Uerror error
	ID     string
}

Errors that does not infect cicd.

func CheckRepoConfig

func CheckRepoConfig(repoarray []config.Repo) (string, []UncriticalError, error)

CheckRepoConfig checks if any attr is empty.

Jump to

Keyboard shortcuts

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