Documentation
¶
Index ¶
- Constants
- func CommandsSchema() *jsonschema.Schema
- func ShellCommandString(cmd string) string
- func Spread[T Spreadable](left []T, right []T) []T
- func SpreadStrings(left []string, right []string) []string
- type BuildPlan
- type Cache
- type Command
- func NewCopyCommand(src string, dst ...string) Command
- func NewExecCommand(cmd string, options ...ExecOptions) Command
- func NewExecShellCommand(cmd string, options ...ExecOptions) Command
- func NewFileCommand(path, name string, options ...FileOptions) Command
- func NewPathCommand(path string, customName ...string) Command
- func UnmarshalCommand(data []byte) (Command, error)
- func UnmarshalJsonCommand(data []byte) (Command, error)
- func UnmarshalStringCommand(data []byte) (Command, error)
- type CopyCommand
- type Deploy
- type ExecCommand
- type ExecOptions
- type FileCommand
- type FileOptions
- type Filter
- type Layer
- type PathCommand
- type PlanPackages
- type Spreadable
- type Step
- type StringWrapper
Constants ¶
View Source
const ( CacheTypeLocked = "locked" )
View Source
const ( RailpackBuilderImage = "ghcr.io/railwayapp/railpack-builder:latest" RailpackRuntimeImage = "ghcr.io/railwayapp/railpack-runtime:latest" )
Variables ¶
This section is empty.
Functions ¶
func CommandsSchema ¶
func CommandsSchema() *jsonschema.Schema
func ShellCommandString ¶ added in v0.0.31
func Spread ¶ added in v0.0.31
func Spread[T Spreadable](left []T, right []T) []T
func SpreadStrings ¶ added in v0.0.31
Types ¶
type BuildPlan ¶
type BuildPlan struct {
Steps []Step `json:"steps,omitempty"`
Caches map[string]*Cache `json:"caches,omitempty"`
Secrets []string `json:"secrets,omitempty"`
Deploy Deploy `json:"deploy,omitempty"`
}
func NewBuildPlan ¶
func NewBuildPlan() *BuildPlan
type Cache ¶
type Command ¶
type Command interface {
CommandType() string
Spreadable
}
func NewCopyCommand ¶
func NewExecCommand ¶
func NewExecCommand(cmd string, options ...ExecOptions) Command
func NewExecShellCommand ¶
func NewExecShellCommand(cmd string, options ...ExecOptions) Command
func NewFileCommand ¶
func NewFileCommand(path, name string, options ...FileOptions) Command
func NewPathCommand ¶
func UnmarshalCommand ¶
func UnmarshalJsonCommand ¶
func UnmarshalStringCommand ¶
type CopyCommand ¶
type CopyCommand struct {
Image string `json:"image,omitempty" jsonschema:"description=Optional source image to copy from. This can be any public image URL"`
Src string `json:"src" jsonschema:"description=Source path to copy from. Can be a file or directory"`
Dest string `json:"dest" jsonschema:"description=Destination path to copy to. Will be created if it doesn't exist"`
}
CopyCommand represents copying files or directories during the build
func (CopyCommand) CommandType ¶
func (c CopyCommand) CommandType() string
func (CopyCommand) IsSpread ¶ added in v0.0.31
func (c CopyCommand) IsSpread() bool
type Deploy ¶ added in v0.0.23
type Deploy struct {
// The base layer for the deploy step
Base Layer `json:"base,omitempty"`
// The layers for the deploy step
Inputs []Layer `json:"inputs,omitempty"`
// The command to run in the container
StartCmd string `json:"startCommand,omitempty"`
// The variables available to this step. The key is the name of the variable that is referenced in a variable command
Variables map[string]string `json:"variables,omitempty"`
// The paths to prepend to the $PATH environment variable
Paths []string `json:"paths,omitempty"`
}
type ExecCommand ¶
type ExecCommand struct {
Cmd string `json:"cmd" jsonschema:"description=The shell command to execute (e.g. 'go build' or 'npm install')"`
CustomName string `json:"customName,omitempty" jsonschema:"description=Optional custom name to display for this command in build output"`
}
ExecCommand represents a shell command to be executed during the build
func (ExecCommand) CommandType ¶
func (e ExecCommand) CommandType() string
func (ExecCommand) IsSpread ¶ added in v0.0.31
func (e ExecCommand) IsSpread() bool
type ExecOptions ¶
type ExecOptions struct {
CustomName string
}
type FileCommand ¶
type FileCommand struct {
Path string `json:"path" jsonschema:"description=Directory path where the file should be created"`
Name string `json:"name" jsonschema:"description=Name of the file to create"`
Mode os.FileMode `json:"mode,omitempty" jsonschema:"description=Optional Unix file permissions mode (e.g. 0644 for regular file)"`
CustomName string `json:"customName,omitempty" jsonschema:"description=Optional custom name to display for this file operation"`
}
FileCommand represents creating or modifying a file during the build
func (FileCommand) CommandType ¶
func (f FileCommand) CommandType() string
func (FileCommand) IsSpread ¶ added in v0.0.31
func (f FileCommand) IsSpread() bool
type FileOptions ¶
type Filter ¶ added in v0.0.61
type Filter struct {
Include []string `json:"include,omitempty" jsonschema:"description=Files or directories to include"`
Exclude []string `json:"exclude,omitempty" jsonschema:"description=Files or directories to exclude"`
}
func NewIncludeFilter ¶ added in v0.0.61
type Layer ¶ added in v0.0.61
type Layer struct {
Image string `json:"image,omitempty" jsonschema:"description=The image to use as input"`
Step string `json:"step,omitempty" jsonschema:"description=The step to use as input"`
Local bool `json:"local,omitempty" jsonschema:"description=Whether to use local files as input"`
Spread bool `json:"spread,omitempty" jsonschema:"description=Whether to spread the input"`
Filter
}
func NewImageLayer ¶ added in v0.0.61
func NewLocalLayer ¶ added in v0.0.61
func NewStepLayer ¶ added in v0.0.61
func (*Layer) DisplayName ¶ added in v0.0.61
func (Layer) JSONSchema ¶ added in v0.0.61
func (Layer) JSONSchema() *jsonschema.Schema
func (*Layer) UnmarshalJSON ¶ added in v0.0.61
type PathCommand ¶
type PathCommand struct {
Path string `` /* 167-byte string literal not displayed */
}
PathCommand represents adding a directory to the global PATH environment variable
func (PathCommand) CommandType ¶
func (g PathCommand) CommandType() string
func (PathCommand) IsSpread ¶ added in v0.0.31
func (p PathCommand) IsSpread() bool
type PlanPackages ¶
type PlanPackages struct {
Apt []string `json:"apt,omitempty"`
Mise map[string]string `json:"mise,omitempty"`
}
func NewPlanPackages ¶
func NewPlanPackages() *PlanPackages
func (*PlanPackages) AddAptPackage ¶
func (p *PlanPackages) AddAptPackage(pkg string)
func (*PlanPackages) AddMisePackage ¶
func (p *PlanPackages) AddMisePackage(pkg string, version string)
type Spreadable ¶ added in v0.0.31
type Spreadable interface {
IsSpread() bool
}
type Step ¶
type Step struct {
Name string `json:"name,omitempty" jsonschema:"description=The name of the step"`
Inputs []Layer `json:"inputs,omitempty" jsonschema:"description=The inputs for this step"`
Commands []Command `json:"commands,omitempty" jsonschema:"description=The commands to run in this step"`
Secrets []string `json:"secrets,omitempty" jsonschema:"description=The secrets that this step uses"`
Assets map[string]string `` /* 153-byte string literal not displayed */
Variables map[string]string `` /* 166-byte string literal not displayed */
Caches []string `` /* 161-byte string literal not displayed */
}
func (*Step) AddCommands ¶
func (Step) JSONSchemaExtend ¶
func (Step) JSONSchemaExtend(schema *jsonschema.Schema)
func (*Step) UnmarshalJSON ¶
type StringWrapper ¶ added in v0.0.31
type StringWrapper struct {
Value string
}
func (StringWrapper) IsSpread ¶ added in v0.0.31
func (s StringWrapper) IsSpread() bool
Click to show internal directories.
Click to hide internal directories.