Skip to content

Commit e9c805c

Browse files
committed
Update docs UI and acceptance fixtures
1 parent a68e5fc commit e9c805c

295 files changed

Lines changed: 26538 additions & 14148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

demo/screengrabs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
artifacts/*
2+
.bin/

demo/screengrabs/Makefile

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,66 @@
11
INSTALL_PATH ?= ../../website/src/components/Screengrabs
2+
ATMOS_RELEASE_VERSION ?= $(shell bash scripts/next-release-version.sh 2>/dev/null)
3+
REPO_ROOT := $(abspath ../..)
4+
BIN_DIR := .bin
5+
ATMOS_BIN := $(BIN_DIR)/atmos
6+
SCREENGRAB_ENV = TERM=xterm-256color COLORTERM=truecolor LANG=en_US.UTF-8 ATMOS_THEME=atmos ATMOS_FORCE_COLOR=true CLICOLOR_FORCE=1 FORCE_COLOR=1 ATMOS_PAGER=false ATMOS_TELEMETRY=false
7+
.PHONY: all install build-atmos build-all docker-build docker-all
8+
29
all: build-all install
310

411
# Write to website/src/components/Screengrabs/
5-
install:
12+
install: validate-artifacts
613
@echo "Installing screengrabs to $(INSTALL_PATH)"
714
@mkdir -p $(INSTALL_PATH)
815
@cp -a artifacts/* $(INSTALL_PATH)
16+
@$(MAKE) validate-installed
17+
18+
build-atmos:
19+
@test -n "$(ATMOS_RELEASE_VERSION)" || (echo "ERROR: Could not determine ATMOS_RELEASE_VERSION from git tags" && exit 1)
20+
@mkdir -p $(BIN_DIR)
21+
@echo "Building atmos $(ATMOS_RELEASE_VERSION) for screengrabs..."
22+
@cd $(REPO_ROOT) && go build -trimpath -o $(abspath $(ATMOS_BIN)) -ldflags "-s -w -X github.com/cloudposse/atmos/pkg/version.Version=$(ATMOS_RELEASE_VERSION)" .
923

10-
build-all:
11-
@./build-all.sh demo-stacks.txt
24+
build-all: build-atmos
25+
@PATH="$(abspath $(BIN_DIR)):$$PATH" $(SCREENGRAB_ENV) ./build-all.sh demo-stacks.txt
26+
@$(MAKE) validate-artifacts
27+
28+
validate-artifacts:
1229
@echo "Validating screengrabs..."
1330
@! grep -r "atmos: not found" artifacts/ || (echo "ERROR: Found 'atmos: not found' in screengrabs" && exit 1)
1431
@! grep -r "COMMAND_EXIT_CODE" artifacts/ || (echo "ERROR: Found 'COMMAND_EXIT_CODE' in screengrabs" && exit 1)
1532
@! grep -r "Script started" artifacts/ || (echo "ERROR: Found 'Script started' messages in screengrabs" && exit 1)
1633
@! grep -r "Script done" artifacts/ || (echo "ERROR: Found 'Script done' messages in screengrabs" && exit 1)
34+
@! grep -r "background-color:" artifacts/ || (echo "ERROR: Found inline background colors in screengrabs" && exit 1)
35+
@! grep -r "Atmos test" artifacts/ || (echo "ERROR: Found test-stamped Atmos version in screengrabs" && exit 1)
36+
@! grep -r "Update available!.*test" artifacts/ || (echo "ERROR: Found test-stamped update prompt in screengrabs" && exit 1)
1737
@echo "✓ All screengrabs validated successfully"
1838

39+
validate-installed:
40+
@echo "Validating installed screengrabs..."
41+
@! grep -r "background-color:" $(INSTALL_PATH) || (echo "ERROR: Found inline background colors in installed screengrabs" && exit 1)
42+
@! grep -r "Atmos test" $(INSTALL_PATH) || (echo "ERROR: Found test-stamped Atmos version in installed screengrabs" && exit 1)
43+
@! grep -r "Update available!.*test" $(INSTALL_PATH) || (echo "ERROR: Found test-stamped update prompt in installed screengrabs" && exit 1)
44+
@echo "✓ Installed screengrabs validated successfully"
45+
1946
# Generate screengrabs using Docker (cross-platform, recommended)
2047
docker-build:
21-
@echo "Generating screengrabs using Podman (Linux container)..."
48+
@echo "Generating screengrabs using Podman (Linux container) with Atmos $(ATMOS_RELEASE_VERSION)..."
2249
@podman run --rm -v $$(pwd)/../..:/workspace -w /workspace/demo/screengrabs \
2350
--memory=4g \
51+
-e TERM=xterm-256color \
52+
-e COLORTERM=truecolor \
53+
-e LANG=en_US.UTF-8 \
54+
-e ATMOS_THEME=atmos \
2455
-e ATMOS_TELEMETRY=false \
2556
-e ATMOS_FORCE_COLOR=true \
57+
-e CLICOLOR_FORCE=1 \
2658
-e FORCE_COLOR=1 \
2759
ubuntu:22.04 bash -c ' \
2860
set -e && \
2961
apt-get update -qq && \
30-
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq aha make wget tar tree && \
62+
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq aha bat make wget tar tree && \
63+
ln -sf /usr/bin/batcat /usr/local/bin/bat && \
3164
echo "Installing Go 1.26..." && \
3265
ARCH=$$(uname -m | sed "s/x86_64/amd64/; s/aarch64/arm64/") && \
3366
wget -q https://go.dev/dl/go1.26.0.linux-$$ARCH.tar.gz && \
@@ -36,15 +69,20 @@ docker-build:
3669
go version && \
3770
echo "Building atmos from source..." && \
3871
cd /workspace && \
39-
GOMEMLIMIT=3GiB go build -p 2 -o /usr/local/bin/atmos . && \
72+
GOMEMLIMIT=3GiB go build -trimpath -p 2 -o /usr/local/bin/atmos -ldflags "-s -w -X github.com/cloudposse/atmos/pkg/version.Version=$(ATMOS_RELEASE_VERSION)" . && \
4073
atmos version && \
74+
atmos toolchain install hashicorp/terraform && \
75+
export PATH="$$(atmos toolchain path hashicorp/terraform):$$PATH" && \
4176
cd /workspace/demo/screengrabs && \
42-
make build-all && \
77+
make build-all ATMOS_RELEASE_VERSION=$(ATMOS_RELEASE_VERSION) && \
4378
echo "Validating screengrabs..." && \
4479
! grep -r "atmos: not found" artifacts/ && \
4580
! grep -r "COMMAND_EXIT_CODE" artifacts/ && \
4681
! grep -r "Script started" artifacts/ && \
47-
! grep -r "Script done" artifacts/ \
82+
! grep -r "Script done" artifacts/ && \
83+
! grep -r "background-color:" artifacts/ && \
84+
! grep -r "Atmos test" artifacts/ && \
85+
! grep -r "Update available!.*test" artifacts/ \
4886
'
4987
@echo "Screengrabs generated and validated successfully in artifacts/"
5088

demo/screengrabs/README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
11
## Usage
22

3-
Add all commands to `commands.txt` (use `#` to disable generation of the command)
3+
Add all commands to `demo-stacks.txt` (use `#` to disable generation of the command).
44

55
Build all colorized HTML snippets of command output by running:
66

77
```shell
8-
make all
8+
make build-all
9+
```
10+
11+
The Makefile builds a local `atmos` binary for the captures and derives `ATMOS_RELEASE_VERSION` from the latest local release/RC tag (for example, `v1.222.0-rc.8` becomes `1.222.0`). Override it only when the next release version is known to be different:
12+
13+
```shell
14+
make build-all ATMOS_RELEASE_VERSION=1.222.0
915
```
1016

11-
Then install those into `../../website/static/screengrabs' by running
17+
The capture environment uses `TERM=xterm-256color`, `COLORTERM=truecolor`, `ATMOS_THEME=atmos`, and Atmos's documented force-color path. Do not use `TERM=dumb` or force TTY mode for normal captures; those bypass the curated terminal/color behavior that the screengrabs are meant to show.
18+
19+
Then install those into `../../website/src/components/Screengrabs` by running:
1220

1321
```shell
1422
make install
1523
```
1624

17-
All the files in `website/static/screengrabs` should be committed.
25+
You can also build and install in one step:
26+
27+
```shell
28+
make all
29+
```
30+
31+
For a reproducible Linux container workflow, run:
32+
33+
```shell
34+
make docker-all
35+
```
36+
37+
All generated files in `website/src/components/Screengrabs` should be committed. Do not manually edit checked-in screengrab HTML; regenerate it with the script so postprocessing and validation stay consistent.
1838

39+
For a one-off regeneration, create a temporary manifest named `demo-stacks.txt` with only the commands you want, run `./build-all.sh demo-stacks.txt`, then copy only the resulting artifact from `artifacts/` into `website/src/components/Screengrabs`. The manifest name matters because it controls the example directory used for command execution.
1940

2041
Use these screengrabs then inside of any MDX documentation file, add something like this:
2142

demo/screengrabs/build-all.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -e
33
export TERM=xterm-256color
4+
export COLORTERM=truecolor
5+
export LANG=en_US.UTF-8
6+
export ATMOS_THEME=atmos
47

58
# Check for required dependencies
69
MISSING_DEPS=()
@@ -77,6 +80,7 @@ fi
7780
export ATMOS_FORCE_COLOR=true
7881
export FORCE_COLOR=1
7982
export CLICOLOR_FORCE=1
83+
export ATMOS_TELEMETRY=false
8084

8185
# Ensure that the output is not paginated
8286
export LESS=-X
@@ -197,7 +201,7 @@ postprocess_html() {
197201

198202
# Strip all background colors - they cause visibility issues.
199203
# aha adds background-color to code blocks which makes text invisible when colors match.
200-
sed_inplace 's/background-color:[^;]*;//g' $file
204+
sed_inplace -E 's/background-color[[:space:]]*:[[:space:]]*[^;"'\'']*;?//g' $file
201205
}
202206

203207
manifest=$1

demo/screengrabs/demo-stacks.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ atmos ai chat --help
99
atmos ai exec --help
1010
atmos ai sessions --help
1111
atmos ai skill --help
12+
atmos ansible --help
13+
atmos ansible playbook --help
14+
atmos ansible version --help
1215
atmos lsp --help
1316
atmos lsp start --help
1417
atmos mcp --help
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
git tag --sort=-v:refname \
5+
| sed -nE 's/^v([0-9]+\.[0-9]+\.[0-9]+)(-rc\.[0-9]+)?$/\1/p' \
6+
| head -n 1

examples/quick-start-simple/atmos.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ stacks:
1515
excluded_paths:
1616
- "**/_defaults.yaml"
1717
name_template: "{{ .vars.stage }}"
18-
19-
logs:
20-
level: Info

tests/fixtures/scenarios/flag-inheritance/atmos.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,48 @@ commands:
4747
steps:
4848
- 'echo "Deploying component: {{ .Arguments.component }}"'
4949
- 'echo "To stack: {{ .Flags.stack }}"'
50+
51+
# Test 3: Custom subcommand under the built-in terraform command.
52+
- name: terraform
53+
description: Execute Terraform commands with custom extensions
54+
commands:
55+
- name: provision
56+
description: This command provisions terraform components
57+
arguments:
58+
- name: component
59+
description: Name of the component
60+
flags:
61+
- name: stack
62+
shorthand: s
63+
description: Name of the stack
64+
required: true
65+
steps:
66+
- 'echo "Provisioning component: {{ .Arguments.component }}"'
67+
- 'echo "In stack: {{ .Flags.stack }}"'
68+
69+
# Test 4: Custom command using component_config with --stack.
70+
- name: show
71+
description: Execute 'show' commands
72+
commands:
73+
- name: component
74+
description: Execute 'show component' command
75+
arguments:
76+
- name: component
77+
description: Name of the component
78+
flags:
79+
- name: stack
80+
shorthand: s
81+
description: Name of the stack
82+
required: true
83+
component_config:
84+
component: "{{ .Arguments.component }}"
85+
stack: "{{ .Flags.stack }}"
86+
env:
87+
- key: ATMOS_COMPONENT
88+
value: "{{ .Arguments.component }}"
89+
steps:
90+
- 'echo "Atmos component from argument: {{ .Arguments.component }}"'
91+
- 'echo "ATMOS_COMPONENT: $ATMOS_COMPONENT"'
92+
- 'echo "Atmos stack: {{ .Flags.stack }}"'
93+
- 'echo "Terraform component: {{ .ComponentConfig.component }}"'
94+
- 'echo "Stage: {{ .ComponentConfig.vars.stage }}"'

tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)