builder

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetadataGitSHAVariable is the name of a special variable computed just in time
	// when referenced. The value is computed by MetadataGitSHA func on InterpolateInput.
	// If the value computed value can be over-written by setting it the variable
	// explicitly like --variable="metadata-git-sha=$(git rev-parse HEAD)".
	MetadataGitSHAVariable = "metadata-git-sha"

	// BuildVersionVariable is the name of a special variable when not set has the value of
	// Version field on InterpolateInput returned.
	BuildVersionVariable = "build-version"

	// TileNameVariable is the name of a special variable that is used as the return variable
	// of the tile function during interpolation. When it is not set, the function returns
	// an error.
	TileNameVariable = "tile_name"
)
View Source
const DirtyWorktreeSHAValue = "DEVELOPMENT"

Variables

This section is empty.

Functions

func GitMetadataSHA

func GitMetadataSHA(repositoryDirectory string, isDev bool) (string, error)

func GitStateIsDirty added in v0.90.0

func GitStateIsDirty(repositoryDirectory string) (bool, error)

func PreProcessMetadataWithTileFunction

func PreProcessMetadataWithTileFunction(variables map[string]any, name string, dst io.Writer, in []byte) error

Types

type InterpolateInput

type InterpolateInput struct {
	Version            string
	BOSHVariables      map[string]any
	Variables          map[string]any
	ReleaseManifests   map[string]any
	StemcellManifests  map[string]any
	StemcellManifest   any
	FormTypes          map[string]any
	IconImage          string
	InstanceGroups     map[string]any
	Jobs               map[string]any
	PropertyBlueprints map[string]any
	RuntimeConfigs     map[string]any
	StubReleases       bool
	MetadataGitSHA     string
	SkipKilnMetadata   bool
}

type Interpolator

type Interpolator struct{}

func NewInterpolator

func NewInterpolator() Interpolator

func (Interpolator) Interpolate

func (i Interpolator) Interpolate(input InterpolateInput, name string, templateYAML []byte) ([]byte, error)

type KilnMetadata added in v0.86.0

type KilnMetadata struct {
	MetadataGitSHA string `yaml:"metadata_git_sha"`

	TileName string `yaml:"tile_name,omitempty"`
}

type Metadata

type Metadata map[string]any

type MetadataPartsDirectoryReader

type MetadataPartsDirectoryReader struct {
	// contains filtered or unexported fields
}

func NewMetadataPartsDirectoryReader

func NewMetadataPartsDirectoryReader() MetadataPartsDirectoryReader

func NewMetadataPartsDirectoryReaderWithOrder

func NewMetadataPartsDirectoryReaderWithOrder(topLevelKey, orderKey string) MetadataPartsDirectoryReader

func NewMetadataPartsDirectoryReaderWithTopLevelKey

func NewMetadataPartsDirectoryReaderWithTopLevelKey(topLevelKey string) MetadataPartsDirectoryReader

func (MetadataPartsDirectoryReader) ParseMetadataTemplates

func (r MetadataPartsDirectoryReader) ParseMetadataTemplates(directories []string, variables map[string]any) (map[string]any, error)

func (MetadataPartsDirectoryReader) Read

func (r MetadataPartsDirectoryReader) Read(path string) ([]Part, error)

func (MetadataPartsDirectoryReader) ReadPreProcess

func (r MetadataPartsDirectoryReader) ReadPreProcess(path string, variables map[string]any) ([]Part, error)

type Part

type Part struct {
	File     string
	Name     string
	Metadata any
}

type ReleaseManifestReader

type ReleaseManifestReader struct{}

func NewReleaseManifestReader

func NewReleaseManifestReader() (_ ReleaseManifestReader)

func (ReleaseManifestReader) Read

func (r ReleaseManifestReader) Read(releaseTarballFilepath string) (Part, error)

type StemcellManifest

type StemcellManifest struct {
	Version         string `yaml:"version"`
	OperatingSystem string `yaml:"operating_system"`
}

func (StemcellManifest) MarshalYAML

func (s StemcellManifest) MarshalYAML() (any, error)

type StemcellManifestReader

type StemcellManifestReader struct {
	// contains filtered or unexported fields
}

func NewStemcellManifestReader

func NewStemcellManifestReader(filesystem filesystem) StemcellManifestReader

func (StemcellManifestReader) Read

func (r StemcellManifestReader) Read(stemcellTarball string) (Part, error)

type TileWriter

type TileWriter struct {
	// contains filtered or unexported fields
}

func NewTileWriter

func NewTileWriter(filesystem filesystem, zipper zipper, logger logger) TileWriter

func (TileWriter) Write

func (w TileWriter) Write(generatedMetadataContents []byte, input WriteInput) error

type WriteInput

type WriteInput struct {
	OutputFile           string
	StubReleases         bool
	MigrationDirectories []string
	ReleaseDirectories   []string
	EmbedPaths           []string
	ModTime              time.Time
}

type Zipper

type Zipper struct {
	// contains filtered or unexported fields
}

func NewZipper

func NewZipper() Zipper

func (Zipper) Add

func (z Zipper) Add(path string, file io.Reader) error

func (Zipper) AddWithMode

func (z Zipper) AddWithMode(path string, file io.Reader, mode os.FileMode) error

func (Zipper) Close

func (z Zipper) Close() error

func (Zipper) CreateFolder

func (z Zipper) CreateFolder(path string) error

func (*Zipper) SetModified added in v0.90.0

func (z *Zipper) SetModified(mod time.Time)

func (*Zipper) SetWriter

func (z *Zipper) SetWriter(writer io.Writer)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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