core

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AnsiRed           = "1"
	AnsiYellow        = "3"
	AnsiBlue          = "4"
	AnsiMagenta       = "5"
	AnsiCyan          = "6"
	AnsiWhite         = "7"
	AnsiGray          = "8"
	AnsiBrightBlue    = "12"
	AnsiBrightCyan    = "14"
	AnsiBrightWhite   = "15"
	AnsiBrightMagenta = "13"
	AnsiDarkGray      = "238"
	AnsiMediumGray    = "245"
)

Variables

This section is empty.

Functions

func FormatBuildResult

func FormatBuildResult(br *BuildResult, options ...PrintOptions) string

func FormatHighlight added in v0.32.0

func FormatHighlight(content string) string

func GenerateConfigFromEnvironment

func GenerateConfigFromEnvironment(env *app.Environment) *c.Config

func GenerateConfigFromFile

func GenerateConfigFromFile(app *app.App, env *app.Environment, options *GenerateBuildPlanOptions, logger *logger.Logger) (*c.Config, error)

func GenerateConfigFromOptions

func GenerateConfigFromOptions(options *GenerateBuildPlanOptions) *c.Config

generates a config from the CLI options

func GetConfig

func GetConfig(app *app.App, env *app.Environment, options *GenerateBuildPlanOptions, logger *logger.Logger) (*c.Config, error)

GetConfig merges the options, environment, and file config into a single config

func PrettyPrintBox added in v0.32.0

func PrettyPrintBox(content string)

func PrettyPrintBuildResult

func PrettyPrintBuildResult(buildResult *BuildResult, options ...PrintOptions)

func PrettyPrintJSON added in v0.36.1

func PrettyPrintJSON(output io.Writer, content []byte)

func PrettyPrintSectionHeader added in v0.32.0

func PrettyPrintSectionHeader(output io.Writer, title string)

func ValidatePlan added in v0.0.41

func ValidatePlan(plan *plan.BuildPlan, app *app.App, logger *logger.Logger, options *ValidatePlanOptions) bool

Types

type BuildResult

type BuildResult struct {
	RailpackVersion   string                               `json:"railpackVersion,omitempty"`
	Plan              *plan.BuildPlan                      `json:"plan,omitempty"`
	ResolvedPackages  map[string]*resolver.ResolvedPackage `json:"resolvedPackages,omitempty"`
	Metadata          map[string]string                    `json:"metadata,omitempty"`
	DetectedProviders []string                             `json:"detectedProviders,omitempty"`
	Logs              []logger.Msg                         `json:"logs,omitempty"`
	// always serialized so consumers of the info file can read the outcome of a failed build
	Success bool `json:"success"`
}

func GenerateBuildPlan

func GenerateBuildPlan(app *app.App, env *app.Environment, options *GenerateBuildPlanOptions) (*BuildResult, error)

generates a build plan for the app. The result is never nil: a failure to plan the app is reported with `Success: false` and the reason in `Logs`. A non-nil error is returned only for transient failures (see mise.IsTemporary), which say nothing about the app itself and are worth retrying.

type GenerateBuildPlanOptions

type GenerateBuildPlanOptions struct {
	RailpackVersion          string
	BuildCommand             string
	StartCommand             string
	PreviousVersions         map[string]string
	ConfigFilePath           string
	ErrorMissingStartCommand bool // enabled on railway
}

type PrintOptions

type PrintOptions struct {
	Metadata bool
	Version  string
}

type ValidatePlanOptions added in v0.0.41

type ValidatePlanOptions struct {
	ErrorMissingStartCommand bool
	ProviderToUse            providers.Provider
}

Directories

Path Synopsis
build step that installs packages defined by mise configuration, provider configuration, or user configuration
build step that installs packages defined by mise configuration, provider configuration, or user configuration
cpp
php
procfile
this provider is unique: it used solely to extract a start command
this provider is unique: it used solely to extract a start command
testing utilities
testing utilities

Jump to

Keyboard shortcuts

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