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 ¶
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
Click to show internal directories.
Click to hide internal directories.