Documentation
¶
Index ¶
- func BuildAndPush(ctx context.Context, cfg *config.DeployConfig, opts *DeployOptions) (string, error)
- func Deploy(ctx context.Context, opts *DeployOptions) error
- func EnvDiff(existing, merged map[string]string) []string
- func FormatLastDeploy(st *project.State) string
- func LastLocalDeploy(configPath, env string) string
- func MergedEnv(existing, declared map[string]string, secrets []string, ssmPrefix string) (map[string]string, bool)
- type DeployOptions
- type Deployer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAndPush ¶
func BuildAndPush(ctx context.Context, cfg *config.DeployConfig, opts *DeployOptions) (string, error)
BuildAndPush is the exported entry point for the standalone build command
func Deploy ¶
func Deploy(ctx context.Context, opts *DeployOptions) error
Deploy executes the full deployment pipeline: ssm-sync → build → cdk (--deploy-infra) → deploy → config-sync (lambda) → wait. The image is pushed before CDK runs because the citadel construct pins the task definition to imageTag=<sha>; CDK must never reference an image that is not in ECR yet. Every stage is a named step of a project.Run (see openRun).
func EnvDiff ¶ added in v0.2.0
EnvDiff renders the added/changed keys between existing and merged as sorted, human-readable lines. Values under secret-looking keys are redacted; the CITADEL_* manifest vars are exempt (they hold names, not values). Keys only ever get added or changed — MergedEnv starts from existing, so nothing is removed.
func FormatLastDeploy ¶ added in v0.3.0
FormatLastDeploy renders a State as the two-line `citadel status` summary.
func LastLocalDeploy ¶ added in v0.3.0
LastLocalDeploy summarises .citadel/state/<env>.json next to configPath for `citadel status`. It returns "" when this checkout has no .citadel/ or has never deployed env. It never creates anything.
func MergedEnv ¶ added in v0.2.0
func MergedEnv(existing, declared map[string]string, secrets []string, ssmPrefix string) (map[string]string, bool)
MergedEnv builds the environment map to write to the function: the function's existing env (CDK-set keys survive), overlaid with the declared env: block (citadel keys win collisions), plus the secret manifest when any secrets are declared. changed reports whether merged differs from existing — callers skip the UpdateFunctionConfiguration call when it is false.
Types ¶
type DeployOptions ¶
type DeployOptions struct {
ConfigPath string
Environment string
EnvFile string
DeployInfra bool
SkipSSM bool
SkipConfig bool
DryRun bool
StreamLogs bool
Wait bool
TailLines int
Message string
Out io.Writer // where progress is written; nil means os.Stdout
Version string // citadel version, recorded in .citadel/project.yml
}
DeployOptions configures a deployment pipeline run
type Deployer ¶
type Deployer interface {
Update(ctx context.Context, w io.Writer, cfg *config.DeployConfig, env, imageURI string) error
WaitStable(ctx context.Context, w io.Writer, cfg *config.DeployConfig, env string) error
}
Deployer performs the runtime-specific "update to new image" step and an optional wait for the deployment to stabilize, writing progress to w.