nodejs

package
v0.0.0-...-25f2897 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const WorkingDir = "/app"

Variables

View Source
var SharedKeys = struct {
	BuildContext string
	ConfigFiles  string
	PackageFiles string
}{
	BuildContext: "build-context",
	ConfigFiles:  "config-files",
	PackageFiles: "package-files",
}

Functions

func RegisterKind

func RegisterKind(reg *registry.KindRegistry)

Types

type Definition

type Definition struct {
	BaseStage Stage `mapstructure:",squash"`

	BaseImage  string          `mapstructure:"base"`
	Version    string          `mapstructure:"version"`
	Alpine     bool            `mapstructure:"alpine"`
	Stages     DerivedStageSet `mapstructure:"stages"`
	IsFrontend bool            `mapstructure:"frontend"`

	SourceContext *builddef.Context `mapstructure:"source_context"`

	Locks DefinitionLocks `mapstructure:"-"`
}

func NewKind

func NewKind(genericDef *builddef.BuildDef) (Definition, error)

@TODO: rename into NewDefinition

func (Definition) Copy

func (d Definition) Copy() Definition

func (Definition) IsValid

func (d Definition) IsValid() error

func (Definition) Merge

func (base Definition) Merge(overriding Definition) Definition

func (*Definition) ResolveStageDefinition

func (def *Definition) ResolveStageDefinition(
	name string,
	withLocks bool,
) (StageDefinition, error)

type DefinitionLocks

type DefinitionLocks struct {
	BaseImage     string                `mapstructure:"base"`
	OSRelease     builddef.OSRelease    `mapstructure:"osrelease"`
	Stages        map[string]StageLocks `mapstructure:"stages"`
	SourceContext *builddef.Context     `mapstructure:"source_context"`
}

func (DefinitionLocks) RawLocks

func (l DefinitionLocks) RawLocks() map[string]interface{}

@TODO: add a generic way to transform locks into rawlocks

type DerivedStage

type DerivedStage struct {
	Stage `mapstructure:",squash"`

	DeriveFrom string `mapstructure:"from"`
	Dev        *bool  `mapstructure:"dev"`
}

func (DerivedStage) Copy

func (s DerivedStage) Copy() DerivedStage

func (DerivedStage) Merge

func (s DerivedStage) Merge(overriding DerivedStage) DerivedStage

type DerivedStageSet

type DerivedStageSet map[string]DerivedStage

func (DerivedStageSet) Copy

func (set DerivedStageSet) Copy() DerivedStageSet

func (DerivedStageSet) Merge

func (base DerivedStageSet) Merge(overriding DerivedStageSet) DerivedStageSet

type NodeJSHandler

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

func (*NodeJSHandler) Build

func (h *NodeJSHandler) Build(
	ctx context.Context,
	buildOpts builddef.BuildOpts,
) (llb.State, *image.Image, error)

func (*NodeJSHandler) DebugConfig

func (h *NodeJSHandler) DebugConfig(
	buildOpts builddef.BuildOpts,
) (interface{}, error)

func (*NodeJSHandler) UpdateLocks

func (*NodeJSHandler) WithSolver

func (h *NodeJSHandler) WithSolver(solver statesolver.StateSolver)

type Stage

type Stage struct {
	ExternalFiles  []llbutils.ExternalFile     `mapstructure:"external_files"`
	SystemPackages *builddef.VersionMap        `mapstructure:"system_packages"`
	GlobalPackages *builddef.VersionMap        `mapstructure:"global_packages"`
	BuildCommand   *string                     `mapstructure:"build_command"`
	Command        *[]string                   `mapstructure:"command"`
	ConfigFiles    builddef.PathsMap           `mapstructure:"config_files"`
	Sources        []string                    `mapstructure:"sources"`
	StatefulDirs   []string                    `mapstructure:"stateful_dirs"`
	Healthcheck    *builddef.HealthcheckConfig `mapstructure:"healthcheck"`
}

func (Stage) Copy

func (s Stage) Copy() Stage

func (Stage) Merge

func (s Stage) Merge(overriding Stage) Stage

type StageDefinition

type StageDefinition struct {
	Stage
	Name       string
	Version    string
	Dev        *bool
	IsFrontend bool
	DefLocks   DefinitionLocks
	StageLocks StageLocks
	// PackageManager is determined during the build process to let the
	// nodejs builder use the right package manager based on which lock file
	// is available (either package-lock.json or yarn.lock).
	PackageManager string
}

StageDefinition is the final structure representing the complete definition of a stage. It's created by merging a stage with all its ancestors. It also contains the locked data for itself and the root definition locks. As such, all the data needed to build the LLB DAG for a stage are available from there.

type StageLocks

type StageLocks struct {
	SystemPackages map[string]string `mapstructure:"system_packages"`
}

func (StageLocks) RawLocks

func (l StageLocks) RawLocks() map[string]interface{}

Jump to

Keyboard shortcuts

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