config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRepo

func InitRepo(dir string) *git2.Repository

func InitRepoWithCommit

func InitRepoWithCommit(dir string) (plumbing.Hash, *git2.Repository)

func UnmarshalStrict added in v0.0.30

func UnmarshalStrict(content []byte, out interface{}) error

Types

type CIConfig

type CIConfig struct {
	Azure     *ci.Azure     `yaml:"azure"`
	Buildkite *ci.Buildkite `yaml:"buildkite"`
	Gitlab    *ci.Gitlab    `yaml:"gitlab"`
	Github    *ci.Github    `yaml:"github"`
	TeamCity  *ci.TeamCity  `yaml:"teamcity"`
	ImageName string        `env:"IMAGE_NAME"`
}

type CacheConfig added in v0.4.2

type CacheConfig struct {
	// ECR configures AWS ECR as a layer cache backend for buildkit builds.
	ECR *ECRCache `yaml:"ecr"`
}

CacheConfig configures buildkit layer cache storage.

type Config

type Config struct {
	VCS                 *VCSConfig        `yaml:"vcs"`
	CI                  *CIConfig         `yaml:"ci"`
	Registry            *RegistryConfig   `yaml:"registry"`
	Cache               *CacheConfig      `yaml:"cache"`
	Targets             map[string]Target `yaml:"targets"`
	Git                 Git               `yaml:"git"`
	Gitops              map[string]Gitops `yaml:"gitops"`
	AvailableCI         []ci.CI
	AvailableRegistries []registry.Registry
}

func InitEmptyConfig

func InitEmptyConfig() *Config

func Load

func Load(dir string) (*Config, error)

func (*Config) CurrentCI

func (c *Config) CurrentCI() ci.CI

func (*Config) CurrentGitops added in v0.2.0

func (c *Config) CurrentGitops(target string) (*Gitops, error)

func (*Config) CurrentRegistry

func (c *Config) CurrentRegistry() registry.Registry

func (*Config) CurrentTarget added in v0.0.27

func (c *Config) CurrentTarget(target string) (*Target, error)

func (*Config) CurrentVCS

func (c *Config) CurrentVCS() vcs.VCS

func (*Config) Print added in v0.1.1

func (c *Config) Print(target io.Writer) error

type ECRCache added in v0.4.2

type ECRCache struct {
	// Url is the ECR repository URL to use for cache storage (e.g., 123456789.dkr.ecr.us-east-1.amazonaws.com/cache-repo)
	Url string `yaml:"url" env:"BUILDTOOLS_CACHE_ECR_URL"`
	// Tag is the tag to use for the cache image (default: "buildcache")
	Tag string `yaml:"tag" env:"BUILDTOOLS_CACHE_ECR_TAG"`
}

ECRCache configures ECR-based layer caching for buildkit builds. This enables remote caching using ECR registry-based cache storage. See: https://aws.amazon.com/blogs/containers/announcing-remote-cache-support-in-amazon-ecr-for-buildkit-clients/

func (*ECRCache) AsRegistry added in v0.4.2

func (c *ECRCache) AsRegistry() *registry.ECR

AsRegistry returns an ECR registry instance for authenticating to the cache registry. This allows the cache to authenticate independently of the image registry.

func (*ECRCache) CacheRef added in v0.4.2

func (c *ECRCache) CacheRef() string

CacheRef returns the full cache reference (url:tag).

func (*ECRCache) Configured added in v0.4.2

func (c *ECRCache) Configured() bool

Configured returns true if ECR cache is configured.

func (*ECRCache) Validate added in v0.4.2

func (c *ECRCache) Validate() error

Validate checks that the ECR cache configuration is valid. Returns an error if the URL is set but doesn't match the expected ECR URL format.

type Git added in v0.2.0

type Git struct {
	Name  string `yaml:"name"`
	Email string `yaml:"email"`
	Key   string `yaml:"key"`
}

type Gitops added in v0.2.0

type Gitops struct {
	URL  string `yaml:"url,omitempty"`
	Path string `yaml:"path,omitempty"`
}

type RegistryConfig

type RegistryConfig struct {
	Dockerhub *registry.Dockerhub `yaml:"dockerhub"`
	ACR       *registry.ACR       `yaml:"acr"`
	ECR       *registry.ECR       `yaml:"ecr"`
	Github    *registry.Github    `yaml:"github"`
	Gitlab    *registry.Gitlab    `yaml:"gitlab"`
	Quay      *registry.Quay      `yaml:"quay"`
	GCR       *registry.GCR       `yaml:"gcr"`
}

type Target added in v0.0.27

type Target struct {
	Context    string `yaml:"context"`
	Namespace  string `yaml:"namespace,omitempty"`
	Kubeconfig string `yaml:"kubeconfig,omitempty"`
}

type VCSConfig

type VCSConfig struct {
	VCS vcs.VCS
}

Jump to

Keyboard shortcuts

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