initialize

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package initialize implements the deployah init command.

The interactive init flow walks through project name, environments, components, and resource settings, then writes a deployah.yaml spec with schema defaults applied. Dry-run mode previews the file without saving.

Register the command with Register on a nabat.dev/nabat.App instance.

Index

Constants

View Source
const (
	// DefaultOutputFile is the default spec path written by init.
	DefaultOutputFile = "deployah.yaml"
	// DefaultCPUThreshold is the default HPA CPU target percentage.
	DefaultCPUThreshold = 75
	// DefaultMinReplicas is the default minimum replica count for HPA.
	DefaultMinReplicas = 2
	// DefaultMaxReplicas is the default maximum replica count for HPA.
	DefaultMaxReplicas = 5
)
View Source
const (
	// DefaultEnvironmentName is used when init runs without prompting.
	DefaultEnvironmentName = "local"
	// DefaultComponentName is the single component created when init runs
	// without prompting.
	DefaultComponentName = "app"
	// DefaultComponentImage is an unresolvable placeholder (no registry, no
	// tag), so a forgotten replacement fails fast at the first deploy
	// instead of shipping a real-looking image that isn't theirs.
	DefaultComponentImage = "REPLACE_ME"
)
View Source
const (
	// StepProjectName is the prompt title for the project name step.
	StepProjectName = "Step 1/3: Project Name"
	// StepEnvironments is the prompt title for the environments step.
	StepEnvironments = "Step 2/3: Environments"
	// StepComponents is the prompt title for the components step.
	StepComponents = "Step 3/3: Components"
)

Variables

This section is empty.

Functions

func Register

func Register(app *nabat.App)

Register adds the init command to app.

Types

type Options

type Options struct {
	Output       string   `nabat:"output"`
	DryRun       bool     `nabat:"dry-run"`
	Force        bool     `nabat:"force"`
	Project      string   `nabat:"project"`
	Environments []string `nabat:"environments"`
	Set          []string `nabat:"set"`
	Defaults     bool     `nabat:"defaults"`
}

Options holds command-line flags for init.

type ProjectConfig

type ProjectConfig struct {
	Name string
	// EnvironmentNames are registered in the platform file, not in the
	// generated spec: the spec's environments map is overrides-only.
	EnvironmentNames []string
	Components       map[string]spec.Component
	OutputPath       string
	DryRun           bool
	// Sets holds --set overrides (Helm-style dotted paths, e.g.
	// "components.web.image=nginx:1.25"), applied on top of Name and
	// Components right before validation.
	Sets []string
}

ProjectConfig holds the collected configuration data

Jump to

Keyboard shortcuts

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