Documentation
¶
Overview ¶
Package preview creates, updates and deletes preview copies of a release in the catalog.
A preview is a copy of a source release named <sourceRelease><suffix>, pinned to a specific build version and marked with the v1alpha1.PreviewLabel so that `joy build promote` excludes it. Callers layer their own transforms via patches (RFC 6902) and regex replacements.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(params CreateParams) error
Create writes (or, if it already exists, version-bumps) the preview copy of a release.
New preview: copy source → built-ins (metadata.name, preview label, version) → patches → replacements → placeholder substitution (__RELEASE__, __SUFFIX__). Existing preview: only spec.version is re-patched (copy is idempotent; other transforms are not re-applied).
func Delete ¶
func Delete(params DeleteParams) error
Delete removes the preview copy of a release, if it exists.
Types ¶
type CreateParams ¶
type CreateParams struct {
Catalog *catalog.Catalog
Writer yml.Writer
Env string
Release string // source release name
Suffix string // appended to Release to form the preview name; includes any leading dash
Version string
Patches []patch.Op
Replaces []Replacement
}
CreateParams are the inputs to Create.
type DeleteParams ¶
DeleteParams are the inputs to Delete.
type Replacement ¶
type Replacement struct {
Search string `yaml:"search" json:"search"`
Replace string `yaml:"replace" json:"replace"`
}
Replacement is a single regex search/replace applied to the preview file text.