Documentation ¶
Overview ¶
Package clonerefs is a library for cloning references
Index ¶
Constants ¶
const ( // JSONConfigEnvVar is the environment variable that // clonerefs expects to find a full JSON configuration // in when run. JSONConfigEnvVar = "CLONEREFS_OPTIONS" // DefaultGitUserName is the default name used in git config DefaultGitUserName = "ci-robot" // DefaultGitUserEmail is the default email used in git config DefaultGitUserEmail = "ci-robot@k8s.io" )
Variables ¶
This section is empty.
Functions ¶
func BindOptions ¶
BindOptions adds flags to the FlagSet that populate the GCS upload options struct given.
func Encode ¶
Encode will encode the set of options in the format that is expected for the configuration environment variable
func ParseRefs ¶
ParseRefs parses a human-provided string into the repo that should be cloned and the refs that need to be checked out once it is. The format is:
org,repo=base-ref[:base-sha][,pull-id[:pull-sha[:pull-ref]]]...
For the base ref and pull IDs, a SHA may optionally be provided or may be omitted for the latest available SHA. Examples:
kubernetes,test-infra=master kubernetes,test-infra=master:abcde12 kubernetes,test-infra=master:abcde12,34 kubernetes,test-infra=master:abcde12,34:fghij56 kubernetes,test-infra=master,34:fghij56 kubernetes,test-infra=master:abcde12,34:fghij56,78 gerrit,test-infra=master:abcde12,34:fghij56:refs/changes/00/123/1
Types ¶
type Options ¶
type Options struct { // SrcRoot is the root directory under which // all source code is cloned SrcRoot string `json:"src_root"` // Log is the log file to which clone records are written Log string `json:"log"` // GitUserName is an optional field that is used with // `git config user.name` GitUserName string `json:"git_user_name,omitempty"` // GitUserEmail is an optional field that is used with // `git config user.email` GitUserEmail string `json:"git_user_email,omitempty"` // GitRefs are the refs to clone GitRefs []*kube.Refs `json:"refs"` // KeyFiles are files containing SSH keys to be used // when cloning. Will be added to `ssh-agent`. KeyFiles []string `json:"key_files,omitempty"` // MaxParallelWorkers determines how many repositories // can be cloned in parallel. If 0, interpreted as no // limit to parallelism MaxParallelWorkers int `json:"max_parallel_workers,omitempty"` // contains filtered or unexported fields }
Options configures the clonerefs tool completely and may be provided using JSON or user-specified flags, but not both.
func (*Options) BindOptions ¶
BindOptions binds flags to options
func (*Options) ConfigVar ¶
ConfigVar exposes the environment variable used to store serialized configuration
func (*Options) LoadConfig ¶
LoadConfig loads options from serialized config