stackdetect

package
v0.2.0-beta.18 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stackdetect inspects a local project directory and guesses how the platform should build it. Provider ids match Railpack's (node, golang, java, python), so a result lines up with what a real deploy will detect.

Index

Constants

View Source
const (
	BuildDockerfile = "dockerfile"
	BuildRailpack   = "railpack"
	BuildStatic     = "static"
	BuildCompose    = "compose"
)

Build types, matching internal/spec's build.type values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack struct {
	// Provider is the Railpack provider id, or "dockerfile", "compose",
	// "static", or "" when nothing matched.
	Provider string
	// Label is the human-readable stack name.
	Label string
	// Build is the app.yaml build.type to use, empty when nothing matched.
	Build string
	// Path is build.path, set for dockerfile, compose and static.
	Path string
	// Port is the container port, 0 for static sites and unknown stacks.
	Port int
	// Name is a suggested service name.
	Name string
	// Notes are short hints for the person reading the result.
	Notes []string
}

Stack is the detection result for one project directory.

func Detect

func Detect(dir string) (Stack, error)

Detect inspects dir without executing anything from it. Order: Dockerfile, compose file, package.json, go.mod, Java, Python, static site.

func (Stack) Detected

func (s Stack) Detected() bool

Detected reports whether a buildable stack was found.

Jump to

Keyboard shortcuts

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