Summary
As a Nullstone user or CI/CD pipeline, I want a single CLI command that packages and publishes an embedded module and then runs a plan and apply against a target workspace — so I can test module changes locally and automate module deployments in pipelines without manual multi-step processes.
Background
The GitOps auto-publish flow (Story 2) covers the merge-to-branch path. But developers also need to test module changes before merging, and CI/CD pipelines may need to publish and apply on demand outside of the standard GitOps trigger. The nullstone apply --publish command provides this path.
The command is designed for two primary contexts:
- Local development: A developer iterates on a module in a sandbox environment, running plan and apply interactively.
- CI/CD pipelines: A pipeline step publishes and applies a module change as part of a deployment workflow, with non-interactive approval and optional async execution.
Command Signature
nullstone apply --publish [--auto-approve] [--async] [--module-path <path>] [--stack <stack>] [--env <env>] [--block <block>]
Flags
| Flag |
Description |
--publish |
Package and publish the module before running plan/apply. Without this flag, the command behaves like the existing apply. |
--auto-approve |
Automatically approve the plan if it succeeds, without prompting. Required for non-interactive CI/CD use. |
--async |
Trigger the run and exit immediately, printing a dashboard link instead of streaming logs. |
--module-path <path> |
Path to the module directory to publish. Defaults to the current working directory. |
--stack <stack> |
Target Nullstone stack. |
--env <env> |
Target environment within the stack. |
--block <block> |
Target block (workspace) within the stack/environment. |
Acceptance Criteria
Publish Phase
Plan Phase
Approval Phase (interactive, default)
Apply Phase
Async Mode (--async)
Log Streaming
Exit Codes
| Code |
Meaning |
0 |
Success (apply complete, or async run queued, or user declined and plan link printed). |
1 |
Plan failed. |
2 |
Apply failed. |
3 |
Publish failed. |
130 |
User declined apply at interactive prompt. |
CI/CD Usage
Local Dev: --local-module Override
Output Design Summary
Publishing module: custom-rds
Packaging... ✓ (234ms)
Uploading... ✓ (1.2s)
Version: 0.0.0-abc1234
Module published successfully.
Planning infrastructure changes...
Stack: primary / Env: dev / Block: api
──────────────────────────────────────────
~ aws_rds_cluster.main
engine_version: "13.4" → "15.3"
+ aws_rds_cluster_parameter_group.custom
Plan: 1 to add, 1 to change, 0 to destroy.
──────────────────────────────────────────
Do you want to apply these changes? [y/N]: y
Applying infrastructure changes...
[streaming apply logs]
Apply complete. Resources: 1 added, 1 changed.
Out of Scope
nullstone modules publish as a standalone command without plan/apply (tracked separately).
- Promoting build versions to release channels via this command.
- Running plans against multiple workspaces in a single invocation.
Summary
As a Nullstone user or CI/CD pipeline, I want a single CLI command that packages and publishes an embedded module and then runs a plan and apply against a target workspace — so I can test module changes locally and automate module deployments in pipelines without manual multi-step processes.
Background
The GitOps auto-publish flow (Story 2) covers the merge-to-branch path. But developers also need to test module changes before merging, and CI/CD pipelines may need to publish and apply on demand outside of the standard GitOps trigger. The
nullstone apply --publishcommand provides this path.The command is designed for two primary contexts:
Command Signature
Flags
--publishapply.--auto-approve--async--module-path <path>--stack <stack>--env <env>--block <block>Acceptance Criteria
Publish Phase
--publishis specified, Nullstone packages the module at the resolved path and publishes a new build version before triggering a plan.--module-pathflag → current working directory → module declaration in.nullstone/config.ymlmatching the cwd (in that order of precedence).--module-pathmatches multiple declared modules, Nullstone errors with a clear message asking the user to specify--blockor--module-path.0.0.0-<short-sha>), not a release version.Plan Phase
--asyncis specified).1and no apply is triggered.Approval Phase (interactive, default)
--auto-approveis not specified and the plan succeeds, the user is prompted:yoryestriggers the apply. Any other input (including Enter) cancels.130.Apply Phase
--auto-approve), Nullstone triggers the apply.--asyncis specified).0.2.Async Mode (
--async)--asyncis specified, the command triggers the plan (and apply, if--auto-approveis also set) and exits immediately after the run is queued.--asyncwithout--auto-approvetriggers only a plan (not an apply). The output explicitly states that apply requires manual approval in the dashboard.--asyncis compatible with--publish. Publish completes synchronously before the async run is queued.Log Streaming
Exit Codes
0123130CI/CD Usage
--auto-approveis specified (no prompts, no TTY required).Local Dev:
--local-moduleOverride--local-module <path>flag allows developers to inject a local module path in place of a registry reference, without publishing.dev_overridesin.terraformrc— the module is used directly from disk.--local-moduleand--publishare mutually exclusive; specifying both produces an error.Output Design Summary
Out of Scope
nullstone modules publishas a standalone command without plan/apply (tracked separately).