bake

package
v0.94.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const RecordsDirectory = "bake_records"

RecordsDirectory should be a sibling to Kilnfile or base.yml

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	// SourceRevision is the commit checked out when the build was run
	SourceRevision string `yaml:"source_revision" json:"source_revision"`

	// Version is the tile version used for product template field `product_version`
	Version string `yaml:"version" json:"version"`

	// KilnVersion is the Kiln CLI version
	KilnVersion string `yaml:"kiln_version,omitempty" json:"kiln_version,omitempty"`

	// TileName might record the tile name used in baking because sometimes multiple tiles can be generated from the same tile source directory
	// An example of this is the two Tanzu Application Service tiles with different topologies listed on TanzuNetwork.
	TileName string `yaml:"tile_name,omitempty" json:"tile_name,omitempty"`

	// FileChecksum may be the SHA256 checksum of the baked tile.
	FileChecksum string `yaml:"file_checksum,omitempty" json:"file_checksum,omitempty"`

	// TileDirectory may be the directory containing tile source.
	TileDirectory string `yaml:"tile_directory,omitempty" json:"tile_directory,omitempty"`
}

Record is created by the function

func NewRecord

func NewRecord(fileChecksum string, productTemplateBytes []byte) (Record, error)

NewRecord parses build information from an OpsManger Product Template (aka metadata/metadata.yml)

func NewRecordFromFile

func NewRecordFromFile(tileFilepath string) (Record, error)

NewRecordFromFile parses the product template and pulls the kiln metadata out. The SHA256 sum is also calculated for the file.

func ReadRecords

func ReadRecords(dir fs.FS) ([]Record, error)

func (Record) CompareTileName

func (record Record) CompareTileName(o Record) int

func (Record) CompareVersion

func (record Record) CompareVersion(o Record) int

func (Record) IsDevBuild

func (record Record) IsDevBuild() bool

func (Record) IsEquivalent

func (record Record) IsEquivalent(other Record, logger *log.Logger) bool

func (Record) Name

func (record Record) Name() string

func (Record) SetTileDirectory

func (record Record) SetTileDirectory(tileSourceDirectory string) (Record, error)

func (Record) WriteFile

func (record Record) WriteFile(tileSourceDirectory string) error

Jump to

Keyboard shortcuts

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