source

package
v0.0.0-...-4c17a3b Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSecretNotFound = errors.New("Secret not found")

Functions

This section is empty.

Types

type Repository

type Repository struct {
	*git.Repository
	// contains filtered or unexported fields
}

func Git

func Git(ctx context.Context, opts RepositoryOpts) (*Repository, error)

Git returns a fully configured Repository that can be used to build an image. If the repository is private, the proper credentials needs to be included as part of RepositoryOpts.

The Repository will be checked out using the Reference passed in the RepositoryOpts

func (*Repository) BuildContext

func (r *Repository) BuildContext() string

BuildContext return the absolute path to the context set by the user.

func (*Repository) Dockerfile

func (r *Repository) Dockerfile() string

func (*Repository) Path

func (r *Repository) Path() string

Path returns the temporary path where the repository was cloned.

func (*Repository) Ref

func (r *Repository) Ref() (string, error)

Ref returns the git reference(https://git-scm.com/book/en/v2/Git-Internals-Git-References) that was used to clone this repository. It is unlikely that a valid cloned repo returns an error here as it's asking for the Head, which will point at the reference used, but if it does happen, it means the repository is in an unknown state and can't be used to generate an image

type RepositoryOpts

type RepositoryOpts struct {
	BuildContext string
	Commit       string
	Dockerfile   string
	Host         string

	Secrets Secrets
}

type Secret

type Secret struct {
	Host        string `json:"host"`
	AccessKey   string `json:"access_key"`
	SecretToken string `json:"secret_token"`
}

type Secrets

type Secrets []Secret

func SecretsFromReader

func SecretsFromReader(r io.Reader) (Secrets, error)

func (Secrets) SecretForHost

func (s Secrets) SecretForHost(host string) (*Secret, error)

Jump to

Keyboard shortcuts

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