Documentation
¶
Index ¶
- func BuildPackageArchive(rootDir, outputPath string) error
- func LockFilePath(intentPath string) string
- func LoginToRegistry(registry, username, password string, passwordStdin bool) error
- func NormalizeOCIRef(ref string) string
- func PushPackageArchive(archivePath, ref string) error
- func WriteLockFile(intentPath string, sources []model.ResolvedCompositionSource) error
- type Composition
- type PublishPlan
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPackageArchive ¶
BuildPackageArchive validates a composition package directory and writes a .tgz archive.
func LockFilePath ¶
LockFilePath returns the default lock-file path for an intent file.
func LoginToRegistry ¶
LoginToRegistry shells out to `oras login` to store credentials.
func NormalizeOCIRef ¶
NormalizeOCIRef expands short-form references in intent.yaml to a full <registry>/<repo>:<tag>. "sourceplane/devops-compositions" -> "ghcr.io/sourceplane/devops-compositions:latest" "ghcr.io/acme/x" -> "ghcr.io/acme/x:latest" "oci://ghcr.io/acme/x:v1" -> "ghcr.io/acme/x:v1"
func PushPackageArchive ¶ added in v0.20.2
PushPackageArchive publishes a package archive to an OCI registry using oras.
func WriteLockFile ¶
func WriteLockFile(intentPath string, sources []model.ResolvedCompositionSource) error
WriteLockFile writes the resolved composition lock next to the intent.
Types ¶
type Composition ¶
type Composition struct {
Key string
Name string
Description string
DefaultJobName string
InputSchema map[string]interface{}
Jobs []model.JobSpec
JobMap map[string]*model.JobSpec
Schema *jsonschema.Schema
JobRegistryName string
JobRegistryDesc string
SourceName string
SourceKind string
SourceRef string
SourcePath string
ExportPath string
ResolvedDigest string
}
Composition is the resolved internal representation used by planning and validation.
type PublishPlan ¶
type PublishPlan struct {
PackageRoot string
PackageName string
Version string
OCIRef string
Registry string
Repository string
FileCount int
InferredFromGit bool
InferredVersion bool
ManifestVersion string
}
PublishPlan captures a fully-resolved publish target before any side-effecting work.
func ResolvePackPlan ¶
func ResolvePackPlan(packageRoot, versionOverride string) (*PublishPlan, error)
ResolvePackPlan loads the manifest at packageRoot and resolves a version, with no OCI target.
func ResolvePublishPlan ¶
func ResolvePublishPlan(packageRoot, targetRef, versionOverride string) (*PublishPlan, error)
ResolvePublishPlan inspects packageRoot, optional explicit target, and the local git repo to assemble a PublishPlan. targetRef may be empty (then inferred from git remote), a registry-only host (ghcr.io), or a full <reg>/<repo>[:tag]. versionOverride wins when non-empty.
func (PublishPlan) FullRef ¶
func (p PublishPlan) FullRef() string
FullRef returns the canonical <registry>/<repo>:<tag> form.
type Registry ¶
type Registry struct {
Types map[string]*Composition
ByKey map[string]*Composition
Jobs *model.JobRegistry
Bindings map[string]*model.JobBinding
Sources []model.ResolvedCompositionSource
}
Registry holds resolved compositions and the sources they came from.
func LoadFromDir ¶
LoadFromDir loads legacy folder-shaped compositions from a config dir.
func LoadRegistry ¶
LoadRegistry resolves declared composition sources from intent and falls back to the legacy config dir when needed.
func (*Registry) ValidateAllComponents ¶
func (reg *Registry) ValidateAllComponents(normalized *model.NormalizedIntent) error
ValidateAllComponents validates all normalized components against their resolved schemas.