stackbuild

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions struct {
	Log *slog.Logger

	// Name is the name of the application being built
	Name string

	// Version specifies the language/runtime version to use
	// If empty, defaults to latest stable version
	Version string

	// CacheNS specifies the namespace for persistent cache mounts
	CacheNS string

	// The alpine image to use for the base image.
	AlpineImage string

	OnBuild []string
}

BuildOptions contains configuration for stack builds

type BunStack

type BunStack struct {
	MetaStack
}

BunStack implements Stack for Bun

func (*BunStack) Detect

func (s *BunStack) Detect() bool

func (*BunStack) GenerateLLB

func (s *BunStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*BunStack) Name

func (s *BunStack) Name() string

type GoStack

type GoStack struct {
	MetaStack
}

GoStack implements Stack for Go

func (*GoStack) Detect

func (s *GoStack) Detect() bool

func (*GoStack) GenerateLLB

func (s *GoStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*GoStack) Name

func (s *GoStack) Name() string

type MetaStack

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

func (*MetaStack) AddEnv

func (s *MetaStack) AddEnv(key, value string)

func (*MetaStack) Entrypoint

func (s *MetaStack) Entrypoint() string

func (*MetaStack) Image

func (s *MetaStack) Image() ocispecs.Image

func (*MetaStack) SetCmd

func (s *MetaStack) SetCmd(cmd []string)

func (*MetaStack) SetCwd

func (s *MetaStack) SetCwd(cwd string)

func (*MetaStack) SetEntrypoint

func (s *MetaStack) SetEntrypoint(ep []string)

type NodeStack

type NodeStack struct {
	MetaStack
}

NodeStack implements Stack for Node.js

func (*NodeStack) Detect

func (s *NodeStack) Detect() bool

func (*NodeStack) GenerateLLB

func (s *NodeStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*NodeStack) Name

func (s *NodeStack) Name() string

type PythonStack

type PythonStack struct {
	MetaStack
}

PythonStack implements Stack for Python

func (*PythonStack) Detect

func (s *PythonStack) Detect() bool

func (*PythonStack) Entrypoint

func (s *PythonStack) Entrypoint() string

func (*PythonStack) GenerateLLB

func (s *PythonStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*PythonStack) Name

func (s *PythonStack) Name() string

type RubyStack

type RubyStack struct {
	MetaStack
	// contains filtered or unexported fields
}

RubyStack implements Stack for Ruby on Rails

func (*RubyStack) Detect

func (s *RubyStack) Detect() bool

func (*RubyStack) Entrypoint

func (s *RubyStack) Entrypoint() string

func (*RubyStack) Gemfile

func (s *RubyStack) Gemfile() ([]byte, []byte, error)

func (*RubyStack) GenerateLLB

func (s *RubyStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*RubyStack) Name

func (s *RubyStack) Name() string

type Stack

type Stack interface {
	Name() string
	// Detect returns true if the given directory contains code for this stack
	Detect() bool
	// GenerateLLB creates the BuildKit LLB for building this stack
	GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

	Image() ocispecs.Image

	Entrypoint() string
}

Stack represents a programming language/framework stack

func DetectStack

func DetectStack(dir string) (Stack, error)

DetectStack identifies the programming stack in the given directory

Jump to

Keyboard shortcuts

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