continuous

package
v0.32.12 Latest Latest
Warning

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

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

Documentation

Overview

Continuous is used to a git repository cached on disk.

Index

Constants

This section is empty.

Variables

View Source
var EventNames = []string{
	"BuildResult",
}

Functions

func CacheRepo

func CacheRepo(url string, cacheDir string, sshPublicKey string) error

CacheRepo is used to clone a repo using SSH publich key authentication.

func FetchRemote

func FetchRemote(repo *git.Repository, sshPublicKey *ssh.PublicKeys) (map[string]string, []string, error)

FetchRemote performs a fetch of a given repository, returning a the new branch heads and new tags.

func RepoRefs

func RepoRefs(repo *git.Repository) (map[string]string, map[string]string, error)

RepoRefs is used to retrieve the references of a working repo. This is useful to check the state before and after a fetch, to determine the difference.

func SSHPublicKey

func SSHPublicKey(url string, SSHKeyPath string) (*ssh.PublicKeys, error)

SSHPublicKey is used to load an SSH public key for use in authenticating to a git server.

Types

type BuildResult

type BuildResult struct {
	Command  string
	Args     []string
	Dir      string
	Output   []byte
	Time     *time.Time
	ExitCode int
	Duration time.Duration
}

func Build

func Build(commandLine string, cacheDir string) (BuildResult, error)

type CI

type CI struct {
	URL        string
	CacheDir   string
	SSHKeyPath string
}

CI is the configuration for remote URLs, repo caching, and SSH authentication

func NewCI

func NewCI(url, cacheDir, sshKeyPath string) *CI

func (*CI) CheckoutHash

func (c *CI) CheckoutHash(commit string) error

func (*CI) CheckoutTag

func (c *CI) CheckoutTag(tag string) error

func (*CI) Fetch

func (c *CI) Fetch() (map[string]string, []string, error)

Fetch performs a git-fetch from the repo origin.

func (*CI) LatestTag

func (c *CI) LatestTag() string

Jump to

Keyboard shortcuts

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