clone

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatRecord

func FormatRecord(record Record) string

FormatRecord describes the record in a human-readable manner for inclusion into build logs

func PathForRefs

func PathForRefs(baseDir string, refs prowapi.Refs) string

PathForRefs determines the full path to where refs should be cloned

Types

type Command

type Command struct {
	Command string `json:"command"`
	Output  string `json:"output,omitempty"`
	Error   string `json:"error,omitempty"`
	// Duration is the runtime for the command.
	Duration time.Duration `json:"duration,omitempty"`
}

Command is a trace of a command executed while achieving the desired git state.

type Record

type Record struct {
	Refs     prowapi.Refs `json:"refs"`
	Commands []Command    `json:"commands,omitempty"`
	Failed   bool         `json:"failed,omitempty"`

	// FinalSHA is the SHA from ultimate state of a cloned ref
	// This is used to populate RepoCommit in started.json properly
	FinalSHA string `json:"final_sha,omitempty"`

	// Duration is the total runtime for the clone.
	Duration time.Duration `json:"duration,omitempty"`
}

Record is a trace of what the desired git state was, what steps we took to get there, what our final state ended up being, and whether or not we were successful.

func Run

func Run(refs prowapi.Refs, dir, gitUserName, gitUserEmail, cookiePath string, env []string, userGenerator github.UserGenerator, tokenGenerator github.TokenGenerator) Record

Run clones the refs under the prescribed directory and optionally configures the git username and email in the repository as well.

Jump to

Keyboard shortcuts

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