Skip to content

Commit e216bfb

Browse files
committed
feat: Update version to v0.4.2 and add comet init command documentation
1 parent 47faa22 commit e216bfb

5 files changed

Lines changed: 80 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.4.1
1+
VERSION=v0.4.2
22

33
tag:
44
@git tag -a ${VERSION} -m "version ${VERSION}" && git push origin ${VERSION}

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@ comet version
131131
comet plan <stack> [component]
132132
```
133133

134+
### `comet init`
135+
136+
**Description:** Initialize backends and providers without running plan/apply operations.
137+
138+
**Usage:**
139+
```
140+
comet init <stack> [component]
141+
```
142+
143+
Useful for:
144+
- Preparing infrastructure for read-only operations (like `comet output`)
145+
- Troubleshooting provider/backend initialization issues
146+
- CI/CD validation pipelines
147+
134148
### `comet output`
135149

136150
**Description:** Show output values from components.

docs/best-practices.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,20 @@ wait
352352
```bash
353353
# Solution: Re-initialize Terraform
354354
rm -rf .terraform
355-
comet apply <stack> <component>
355+
comet init <stack> <component>
356+
```
357+
358+
**Issue:** "Required plugins are not installed"
359+
```bash
360+
# Solution: Initialize providers and backends
361+
comet init <stack> <component>
356362
```
357363

358364
**Issue:** Cross-stack reference returns null
359365
```bash
360366
# Solution: Ensure referenced stack is applied first
361367
comet apply infra vpc
368+
comet init app webapp # Initialize to query outputs
362369
comet apply app webapp # Now vpc outputs are available
363370
```
364371

website/docs/advanced/best-practices.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,20 @@ jobs:
378378
**Backend configuration changed:**
379379
```bash
380380
rm -rf .terraform
381-
comet apply <stack> <component>
381+
comet init <stack> <component>
382+
```
383+
384+
**Required plugins are not installed:**
385+
```bash
386+
# Initialize providers and backends
387+
comet init <stack> <component>
382388
```
383389

384390
**Cross-stack reference returns null:**
385391
```bash
386392
# Ensure referenced stack is applied first
387393
comet apply infrastructure vpc
394+
comet init application webapp # Initialize to query outputs
388395
comet apply application webapp
389396
```
390397

website/docs/guides/cli-reference.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,44 @@ comet plan production vpc
9393
**Output:**
9494
Shows Terraform plan output with additions, changes, and deletions.
9595

96+
## comet init
97+
98+
Initialize backends and providers without running plan or apply operations. This is useful for setting up the environment before querying outputs or troubleshooting initialization issues.
99+
100+
### Initialize All Components
101+
102+
```bash
103+
comet init <stack>
104+
```
105+
106+
**Example:**
107+
```bash
108+
comet init dev
109+
```
110+
111+
### Initialize a Specific Component
112+
113+
```bash
114+
comet init <stack> <component>
115+
```
116+
117+
**Example:**
118+
```bash
119+
comet init dev vpc
120+
```
121+
122+
**What it does:**
123+
- Generates backend configuration files (`backend.tf.json`)
124+
- Generates provider configuration files (`providers_gen.tf`)
125+
- Downloads required provider plugins
126+
- Configures remote state backend
127+
- Does NOT run plan, apply, or make infrastructure changes
128+
129+
**Use cases:**
130+
- Before running `comet output` on a fresh checkout
131+
- Troubleshooting provider/backend initialization issues
132+
- CI/CD validation pipelines that only need to query infrastructure
133+
96134
## comet apply
97135

98136
Create or update infrastructure based on your configuration.
@@ -290,6 +328,17 @@ comet apply dev
290328
comet output dev
291329
```
292330

331+
### Read-Only Query (Fresh Checkout)
332+
333+
```bash
334+
# 1. Initialize backends and providers
335+
comet init production
336+
337+
# 2. Query infrastructure outputs
338+
comet output production vpc
339+
comet output production gke
340+
```
341+
293342
### Updating Infrastructure
294343

295344
```bash

0 commit comments

Comments
 (0)