ci

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(providerName string, ctx *CIContext, customTemplateDir string) ([]byte, error)

Generate renders CI configuration for the given provider and context. If customTemplateDir is non-empty, templates are loaded from that directory instead of the provider's embedded templates.

func RegisterProvider

func RegisterProvider(p *Provider)

RegisterProvider registers a CI provider.

Types

type CIConfigContext

type CIConfigContext struct {
	Registry *model.RegistryConfig
	Cache    *model.CacheConfig
}

CIConfigContext holds project configuration relevant to CI.

func (*CIConfigContext) RegistryHost added in v0.0.7

func (c *CIConfigContext) RegistryHost() string

RegistryHost returns the registry hostname (without path) for login. E.g., "docker.io/timoreymann" -> "docker.io"

type CIContext

type CIContext struct {
	Images          []CIImage
	Platforms       []string
	Stages          []string
	Config          CIConfigContext
	Artifacts       bool
	Command         string
	Version         string
	ImageName       string
	ProjectPath     string // non-empty when --project is not the default "."
	TemplateOptions map[string]string
}

CIContext holds all data needed to render CI templates.

func BuildCIContext

func BuildCIContext(project *model.ContainerHiveProject, artifacts bool) (*CIContext, error)

BuildCIContext creates a CIContext from a ContainerHive project.

func (*CIContext) ChCmd

func (c *CIContext) ChCmd() string

ChCmd returns the ch command prefix, including -p flag when a project path is set.

func (*CIContext) Dist

func (c *CIContext) Dist() string

Dist returns the dist directory path, prefixed with the project path when set.

type CIImage

type CIImage struct {
	Name         string
	Tags         []string
	Dependencies []string
	Depth        int
	Platforms    []string
}

CIImage represents an image in the CI context.

type Provider

type Provider struct {
	Name       string
	TemplateFS fs.FS
	Entrypoint string
}

Provider represents a CI provider with its template files.

func GetProvider

func GetProvider(name string) (*Provider, error)

GetProvider returns a registered provider by name.

Jump to

Keyboard shortcuts

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