generate

package
v0.0.64 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APT_CACHE_KEY  = "apt"
	MISE_CACHE_KEY = "mise"
)
View Source
const (
	BinDir = "/railpack"
)
View Source
const (
	MisePackageStepName = "packages:mise"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildStepOptions

type BuildStepOptions struct {
	ResolvedPackages map[string]*resolver.ResolvedPackage
	Caches           *CacheContext
}

func (*BuildStepOptions) NewAptInstallCommand

func (o *BuildStepOptions) NewAptInstallCommand(pkgs []string) plan.Command

type CacheContext

type CacheContext struct {
	Caches map[string]*plan.Cache
}

func NewCacheContext

func NewCacheContext() *CacheContext

func (*CacheContext) AddCache

func (c *CacheContext) AddCache(name string, directory string) string

func (*CacheContext) AddCacheWithType added in v0.0.17

func (c *CacheContext) AddCacheWithType(name string, directory string, cacheType string) string

func (*CacheContext) GetAptCaches

func (c *CacheContext) GetAptCaches() []string

func (*CacheContext) GetCache

func (c *CacheContext) GetCache(name string) *plan.Cache

func (*CacheContext) SetCache

func (c *CacheContext) SetCache(name string, cache *plan.Cache)

type Command added in v0.0.31

type Command interface {
	IsSpread() bool
}

type CommandStepBuilder

type CommandStepBuilder struct {
	DisplayName string
	Commands    []plan.Command
	Inputs      []plan.Layer
	Assets      map[string]string
	Variables   map[string]string
	Caches      []string
	Secrets     []string
	// contains filtered or unexported fields
}

func (*CommandStepBuilder) AddCache added in v0.0.9

func (b *CommandStepBuilder) AddCache(name string)

func (*CommandStepBuilder) AddCommand

func (b *CommandStepBuilder) AddCommand(command plan.Command)

func (*CommandStepBuilder) AddCommands

func (b *CommandStepBuilder) AddCommands(commands []plan.Command)

func (*CommandStepBuilder) AddEnvVars

func (b *CommandStepBuilder) AddEnvVars(envVars map[string]string)

func (*CommandStepBuilder) AddInput added in v0.0.23

func (b *CommandStepBuilder) AddInput(input plan.Layer)

func (*CommandStepBuilder) AddInputs added in v0.0.23

func (b *CommandStepBuilder) AddInputs(inputs []plan.Layer)

func (*CommandStepBuilder) AddPaths

func (b *CommandStepBuilder) AddPaths(paths []string)

func (*CommandStepBuilder) AddVariables added in v0.0.9

func (b *CommandStepBuilder) AddVariables(variables map[string]string)

func (*CommandStepBuilder) Build

func (b *CommandStepBuilder) Build(p *plan.BuildPlan, options *BuildStepOptions) error

func (*CommandStepBuilder) Name

func (b *CommandStepBuilder) Name() string

func (*CommandStepBuilder) UseSecrets

func (b *CommandStepBuilder) UseSecrets(secrets []string)

func (*CommandStepBuilder) UseSecretsWithPrefix added in v0.0.11

func (b *CommandStepBuilder) UseSecretsWithPrefix(prefix string)

func (*CommandStepBuilder) UseSecretsWithPrefixes added in v0.0.11

func (b *CommandStepBuilder) UseSecretsWithPrefixes(prefixes []string)

type CommandWrapper added in v0.0.31

type CommandWrapper struct {
	Command plan.Command
}

func (CommandWrapper) IsSpread added in v0.0.31

func (c CommandWrapper) IsSpread() bool

type DeployBuilder added in v0.0.23

type DeployBuilder struct {
	Base         plan.Layer
	DeployInputs []plan.Layer
	StartCmd     string
	Variables    map[string]string
	Paths        []string
	AptPackages  []string
}

func NewDeployBuilder added in v0.0.23

func NewDeployBuilder() *DeployBuilder

func (*DeployBuilder) AddAptPackages added in v0.0.61

func (b *DeployBuilder) AddAptPackages(packages []string)

func (*DeployBuilder) AddInputs added in v0.0.61

func (b *DeployBuilder) AddInputs(layers []plan.Layer)

func (*DeployBuilder) Build added in v0.0.23

func (b *DeployBuilder) Build(p *plan.BuildPlan, options *BuildStepOptions)

func (*DeployBuilder) SetInputs added in v0.0.61

func (b *DeployBuilder) SetInputs(layers []plan.Layer)

type GenerateContext

type GenerateContext struct {
	App    *a.App
	Env    *a.Environment
	Config *config.Config

	BaseImage string
	Steps     []StepBuilder
	Deploy    *DeployBuilder

	Caches  *CacheContext
	Secrets []string

	SubContexts []string

	Metadata        *Metadata
	Resolver        *resolver.Resolver
	MiseStepBuilder *MiseStepBuilder

	Logger *logger.Logger
}

func NewGenerateContext

func NewGenerateContext(app *a.App, env *a.Environment, config *config.Config, logger *logger.Logger) (*GenerateContext, error)

func (*GenerateContext) EnterSubContext

func (c *GenerateContext) EnterSubContext(subContext string) *GenerateContext

func (*GenerateContext) ExitSubContext

func (c *GenerateContext) ExitSubContext() *GenerateContext

func (*GenerateContext) Generate

Generate a build plan from the context

func (*GenerateContext) GetMiseStepBuilder

func (c *GenerateContext) GetMiseStepBuilder() *MiseStepBuilder

func (*GenerateContext) GetStepByName

func (c *GenerateContext) GetStepByName(name string) *StepBuilder

func (*GenerateContext) GetStepName

func (c *GenerateContext) GetStepName(name string) string

func (*GenerateContext) NewCommandStep

func (c *GenerateContext) NewCommandStep(name string) *CommandStepBuilder

func (*GenerateContext) NewImageStep

func (c *GenerateContext) NewImageStep(name string, resolveStepImage func(options *BuildStepOptions) string) *ImageStepBuilder

func (*GenerateContext) NewInstallBinStepBuilder added in v0.0.28

func (c *GenerateContext) NewInstallBinStepBuilder(name string) *InstallBinStepBuilder

func (*GenerateContext) NewMiseStepBuilder added in v0.0.51

func (c *GenerateContext) NewMiseStepBuilder(displayName string) *MiseStepBuilder

func (*GenerateContext) ResolvePackages

func (c *GenerateContext) ResolvePackages() (map[string]*resolver.ResolvedPackage, error)

func (*GenerateContext) TemplateFiles added in v0.0.28

func (c *GenerateContext) TemplateFiles(potentialFiles []string, defaultContents string, data map[string]interface{}) (*TemplateFileResult, error)

TemplateFiles will look the first file that exists in the list of potential files and render it with the given data If no file is found, it will use the default contents and render it with the given data

type ImageStepBuilder

type ImageStepBuilder struct {
	DisplayName      string
	Resolver         *resolver.Resolver
	Packages         []*resolver.PackageRef
	ResolveStepImage func(options *BuildStepOptions) string
	AptPackages      []string
}

func (*ImageStepBuilder) Build

func (b *ImageStepBuilder) Build(p *plan.BuildPlan, options *BuildStepOptions) error

func (*ImageStepBuilder) Default

func (b *ImageStepBuilder) Default(name string, defaultVersion string) resolver.PackageRef

func (*ImageStepBuilder) Name

func (b *ImageStepBuilder) Name() string

func (*ImageStepBuilder) SetVersionAvailable added in v0.0.31

func (b *ImageStepBuilder) SetVersionAvailable(ref resolver.PackageRef, isVersionAvailable func(version string) bool)

func (*ImageStepBuilder) Version

func (b *ImageStepBuilder) Version(name resolver.PackageRef, version string, source string)

type InstallBinStepBuilder added in v0.0.28

type InstallBinStepBuilder struct {
	DisplayName           string
	Resolver              *resolver.Resolver
	SupportingAptPackages []string
	Package               resolver.PackageRef
}

func (*InstallBinStepBuilder) Build added in v0.0.28

func (*InstallBinStepBuilder) Default added in v0.0.28

func (b *InstallBinStepBuilder) Default(name string, defaultVersion string) resolver.PackageRef

func (*InstallBinStepBuilder) GetLayer added in v0.0.61

func (b *InstallBinStepBuilder) GetLayer() plan.Layer

func (*InstallBinStepBuilder) GetOutputPaths added in v0.0.28

func (b *InstallBinStepBuilder) GetOutputPaths() []string

func (*InstallBinStepBuilder) Name added in v0.0.28

func (b *InstallBinStepBuilder) Name() string

func (*InstallBinStepBuilder) Version added in v0.0.28

func (b *InstallBinStepBuilder) Version(name resolver.PackageRef, version string, source string)

type Metadata

type Metadata struct {
	Properties map[string]string `json:"properties"`
}

func NewMetadata

func NewMetadata() *Metadata

func (*Metadata) Get

func (m *Metadata) Get(key string) string

func (*Metadata) Set

func (m *Metadata) Set(key string, value string)

func (*Metadata) SetBool

func (m *Metadata) SetBool(key string, value bool)

type MiseStepBuilder

type MiseStepBuilder struct {
	DisplayName           string
	Resolver              *resolver.Resolver
	SupportingAptPackages []string
	MisePackages          []*resolver.PackageRef
	SupportingMiseFiles   []string
	Assets                map[string]string
	Inputs                []plan.Layer
	Variables             map[string]string
	// contains filtered or unexported fields
}

func (*MiseStepBuilder) AddInput added in v0.0.23

func (b *MiseStepBuilder) AddInput(input plan.Layer)

func (*MiseStepBuilder) AddSupportingAptPackage

func (b *MiseStepBuilder) AddSupportingAptPackage(name string)

func (*MiseStepBuilder) Build

func (b *MiseStepBuilder) Build(p *plan.BuildPlan, options *BuildStepOptions) error

func (*MiseStepBuilder) Default

func (b *MiseStepBuilder) Default(name string, defaultVersion string) resolver.PackageRef

func (*MiseStepBuilder) GetLayer added in v0.0.61

func (b *MiseStepBuilder) GetLayer() plan.Layer

func (*MiseStepBuilder) GetOutputPaths added in v0.0.23

func (b *MiseStepBuilder) GetOutputPaths() []string

func (*MiseStepBuilder) GetSupportingMiseConfigFiles

func (b *MiseStepBuilder) GetSupportingMiseConfigFiles(path string) []string

func (*MiseStepBuilder) Name

func (b *MiseStepBuilder) Name() string

func (*MiseStepBuilder) Version

func (b *MiseStepBuilder) Version(name resolver.PackageRef, version string, source string)

type StepBuilder

type StepBuilder interface {
	Name() string
	Build(p *plan.BuildPlan, options *BuildStepOptions) error
}

type TemplateFileResult added in v0.0.28

type TemplateFileResult struct {
	Filename string
	Contents string
}

Jump to

Keyboard shortcuts

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