generate

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 12 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	APT_CACHE_KEY  = "apt"
	MISE_CACHE_KEY = "mise"
)
View Source
const (
	MisePackageStepName = "packages:mise"
	BuilderBaseImage    = "ghcr.io/railwayapp/railpack-builder-base:latest"
)
View Source
const (
	DefaultBaseImage = "ghcr.io/railwayapp/railpack-runtime-base:latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AptStepBuilder

type AptStepBuilder struct {
	DisplayName string
	DependsOn   []string
	Packages    []string
}

func (*AptStepBuilder) AddAptPackage

func (b *AptStepBuilder) AddAptPackage(pkg string)

func (*AptStepBuilder) Build

func (b *AptStepBuilder) Build(options *BuildStepOptions) (*plan.Step, error)

func (*AptStepBuilder) Name

func (b *AptStepBuilder) Name() string

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 CommandStepBuilder

type CommandStepBuilder struct {
	DisplayName string
	DependsOn   []string
	Commands    []plan.Command
	Outputs     []string
	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) 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(options *BuildStepOptions) (*plan.Step, error)

func (*CommandStepBuilder) DependOn

func (b *CommandStepBuilder) DependOn(name string)

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 GenerateContext

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

	BaseImage string
	Steps     []StepBuilder
	Start     StartContext

	Caches  *CacheContext
	Secrets []string

	SubContexts []string

	Metadata *Metadata

	Resolver *resolver.Resolver
	// contains filtered or unexported fields
}

func NewGenerateContext

func NewGenerateContext(app *a.App, env *a.Environment) (*GenerateContext, error)

func (*GenerateContext) ApplyConfig

func (c *GenerateContext) ApplyConfig(config *config.Config) 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) NewAptStepBuilder

func (c *GenerateContext) NewAptStepBuilder(name string) *AptStepBuilder

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) ResolvePackages

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

type ImageStepBuilder

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

func (*ImageStepBuilder) Build

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

func (*ImageStepBuilder) Default

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

func (*ImageStepBuilder) Name

func (b *ImageStepBuilder) Name() string

func (*ImageStepBuilder) Version

func (b *ImageStepBuilder) 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
	Outputs               []string
	// contains filtered or unexported fields
}

func (*MiseStepBuilder) AddSupportingAptPackage

func (b *MiseStepBuilder) AddSupportingAptPackage(name string)

func (*MiseStepBuilder) Build

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

func (*MiseStepBuilder) Default

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

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 StartContext

type StartContext struct {
	BaseImage string
	Command   string
	// contains filtered or unexported fields
}

func NewStartContext

func NewStartContext() *StartContext

func (*StartContext) AddEnvVars

func (s *StartContext) AddEnvVars(envVars map[string]string)

func (*StartContext) AddOutputs

func (s *StartContext) AddOutputs(outputs []string)

func (*StartContext) AddPaths

func (s *StartContext) AddPaths(paths []string)

type StepBuilder

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

Jump to

Keyboard shortcuts

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