detect

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package detect decides how a folder should be built. The same pipeline backs `donkey init` and `donkey deploy`:

  1. donkey.yaml with an explicit build.type wins
  2. a Dockerfile in the folder (the user's Dockerfile always beats a builder)
  3. a Dockerfile donkey's assistant wrote earlier (.donkey/Dockerfile)
  4. donkey's own builder, which has the assistant write the Dockerfile

Every path ends at a Dockerfile. That is the whole design: donkey builds one kind of thing, so there is one code path to the build engine, and what an app is built with is a file the user can read, edit and keep.

Index

Constants

View Source
const AIDockerfilePath = ".donkey/Dockerfile"

AIDockerfilePath is where a Dockerfile donkey wrote lives — under .donkey/, so a user's own Dockerfile is never clobbered.

View Source
const StackStatic = "static"

StackStatic is a site served as files, by nginx, caddy or httpd.

Variables

This section is empty.

Functions

func Stack

func Stack(baseImages []string) string

Stack names what an app is written in, read off the base images of the Dockerfile it was built from — the one fact every build has, whether the app brought the recipe or the assistant wrote it. The answer is a short key the console turns into an icon ("python", "go", "node", …), or "" when no image says.

A language beats a web server: a site built with node and served by nginx is a node app, a Go binary on distroless is a Go app. Among languages the first stage wins, since builds start from the toolchain.

Types

type Detection

type Detection struct {
	Strategy       config.BuildStrategy
	DockerfilePath string // for the dockerfile strategy
	// GeneratedRecipe also identifies a saved .donkey/Dockerfile selected
	// automatically; security findings may repair it just like a fresh recipe.
	GeneratedRecipe bool
	// Summary is a one-line plain-language description of what was found.
	Summary string
}

func Detect

func Detect(dir string, app *config.AppConfig) (*Detection, error)

Detect works out how to build dir.

Jump to

Keyboard shortcuts

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