Documentation
¶
Index ¶
- Constants
- Variables
- func CloningError(url string, actual error) error
- func ErrUpstreamNotWritable(url string, actual error) error
- func PushError(url string, actual error) error
- type Checkout
- func (c *Checkout) ChangedFiles(ctx context.Context, ref string) ([]string, error)
- func (c *Checkout) CheckOriginWritable(ctx context.Context) error
- func (c *Checkout) Clean()
- func (c *Checkout) CommitAndPush(ctx context.Context, commitAction *CommitAction, note *Note) error
- func (c *Checkout) CommitsBefore(ctx context.Context, ref string) ([]Commit, error)
- func (c *Checkout) CommitsBetween(ctx context.Context, ref1, ref2 string) ([]Commit, error)
- func (c *Checkout) GetNote(ctx context.Context, rev string) (*Note, error)
- func (c *Checkout) HeadRevision(ctx context.Context) (string, error)
- func (c *Checkout) ManifestDir() string
- func (c *Checkout) MoveTagAndPush(ctx context.Context, ref, msg string) error
- func (c *Checkout) NoteRevList(ctx context.Context) (map[string]struct{}, error)
- func (c *Checkout) Pull(ctx context.Context) error
- func (c *Checkout) TagRevision(ctx context.Context, tag string) (string, error)
- func (c *Checkout) WorkingClone(ctx context.Context) (*Checkout, error)
- type Commit
- type CommitAction
- type Config
- type Note
- type Repo
Constants ¶
const ( DefaultCloneTimeout = 2 * time.Minute CheckPushTag = "flux-write-check" )
Variables ¶
var (
ErrNoChanges = errors.New("no changes made in repo")
)
var NoRepoError = &fluxerr.Error{ Type: fluxerr.User, Err: errors.New("no repo in user config"), Help: `No Git repository URL in your config We need to clone a git repo to proceed, and you haven't supplied one. Please upload a config file, including a git repository URL, as described in https://github.com/weaveworks/flux/blob/master/site/using.md `, }
Functions ¶
func CloningError ¶
func ErrUpstreamNotWritable ¶
Types ¶
type Checkout ¶
Checkout is a local clone of the remote repo.
func (*Checkout) ChangedFiles ¶
ChangedFiles does a git diff listing changed files
func (*Checkout) CheckOriginWritable ¶
CheckOriginWritable tests that we can write to the origin repository; we need to be able to do this to push the sync tag, for example.
func (*Checkout) CommitAndPush ¶
CommitAndPush commits changes made in this checkout, along with any extra data as a note, and pushes the commit and note to the remote repo.
func (*Checkout) CommitsBefore ¶
func (*Checkout) CommitsBetween ¶
func (*Checkout) GetNote ¶
GetNote gets a note for the revision specified, or nil if there is no such note.
func (*Checkout) HeadRevision ¶
func (*Checkout) ManifestDir ¶
ManifestDir returns a path to where the files are
func (*Checkout) MoveTagAndPush ¶
func (*Checkout) NoteRevList ¶
func (*Checkout) Pull ¶
Pull fetches the latest commits on the branch we're using, and the latest notes
func (*Checkout) TagRevision ¶
type CommitAction ¶
CommitAction - struct holding commit information
type Config ¶
type Config struct { SyncTag string NotesRef string UserName string UserEmail string SetAuthor bool }
Config holds some values we use when working in the local copy of the repo