Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document All Atmos Schemas #966

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,27 @@ jobs:
filter_mode: "added"
github_token: ${{ secrets.GITHUB_TOKEN }}

verify-schema-checksums:
name: Check Atmos Schema Checksums Match
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compute checksums of Atmos schema files
run: |
git ls-files '*/atmos-manifest.json' 'website/static/schemas/atmos/1.0/stack.json' | sort | xargs md5sum > checksums.txt
cat checksums.txt

- name: Verify all schema checksums are identical
run: |
if [ "$(cut -d ' ' -f1 < checksums.txt | sort -u | wc -l)" -ne 1 ]; then
echo "❌ Atmos schema checksum mismatch detected!"
cat checksums.txt
exit 1
fi
echo "✅ All Atmos schema files have matching checksums."

release:
needs: [test, lint, mock, k3s, localstack, docker, validate]
if: github.event_name == 'push'
Expand Down
20 changes: 9 additions & 11 deletions atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ stacks:
excluded_paths:
- "**/_defaults.yaml"
# Can also be set using 'ATMOS_STACKS_NAME_PATTERN' ENV var
name_pattern: "{tenant}-{environment}-{stage}"
name_template: "{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}"

workflows:
# Can also be set using 'ATMOS_WORKFLOWS_BASE_PATH' ENV var, or '--workflows-dir' command-line argument
Expand Down Expand Up @@ -231,7 +231,6 @@ commands:

# Integrations
integrations:

# Atlantis integration
# https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html
atlantis:
Expand Down Expand Up @@ -357,17 +356,17 @@ settings:

# Terminal settings for displaying content
terminal:
max_width: 120 # Maximum width for terminal output
pager: true # Pager setting for all terminal output
colors: true # Enable colored output
unicode: true # Use unicode characters
max_width: 120 # Maximum width for terminal output
pager: true # Pager setting for all terminal output
colors: true # Enable colored output
unicode: true # Use unicode characters

syntax_highlighting:
enabled: true
formatter: terminal # Output formatter (e.g., terminal, html)
theme: dracula # Highlighting theme
line_numbers: true # Display line numbers
wrap: false # Wrap long lines
formatter: terminal # Output formatter (e.g., terminal, html)
theme: dracula # Highlighting theme
line_numbers: true # Display line numbers
wrap: false # Wrap long lines

# Markdown element styling
markdown:
Expand All @@ -394,4 +393,3 @@ version:
enabled: true
timeout: 1000 # ms
frequency: 1h

44 changes: 21 additions & 23 deletions examples/demo-atlantis/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,44 @@ components:
deploy_run_init: true
init_run_reconfigure: true
auto_generate_backend_file: false

stacks:
base_path: "stacks"
included_paths:
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_pattern: "{stage}"
name_template: "{{ .vars.stage }}"

logs:
file: "/dev/stderr"
level: Info

commands:
- name: "test"
description: "Run all tests"
steps:
- atmos atlantis build-all

- name: "atlantis"
commands:
- name: "build-all"
description: "Build all configurations for Atlantis"
- name: "test"
description: "Run all tests"
steps:
- echo "Building Atlantis config..."
- atmos atlantis generate repo-config --config-template config-1 --project-template project-1
- echo "Generating varfiles..."
- >-
atmos terraform generate varfiles \
--file-template={component-path}/varfiles/{namespace}-{environment}-{component}.tfvars.json
- echo "Generating varfiles..."
- >-
atmos terraform generate backends \
--format=backend-config \
--file-template={component-path}/backends/{namespace}-{environment}-{component}.backend
- atmos atlantis build-all

- name: "atlantis"
commands:
- name: "build-all"
description: "Build all configurations for Atlantis"
steps:
- echo "Building Atlantis config..."
- atmos atlantis generate repo-config --config-template config-1 --project-template project-1
- echo "Generating varfiles..."
- >-
atmos terraform generate varfiles \
--file-template={component-path}/varfiles/{namespace}-{environment}-{component}.tfvars.json
- echo "Generating varfiles..."
- >-
atmos terraform generate backends \
--format=backend-config \
--file-template={component-path}/backends/{namespace}-{environment}-{component}.backend

# Integrations
integrations:

# Atlantis integration
# https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html
atlantis:
Expand Down
12 changes: 6 additions & 6 deletions examples/demo-component-versions/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ components:
deploy_run_init: true
init_run_reconfigure: true
auto_generate_backend_file: false

stacks:
base_path: "stacks"
included_paths:
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_pattern: "{stage}"
name_template: "{{ .vars.stage }}"

logs:
file: "/dev/stderr"
level: Info

commands:
- name: "test"
description: "Run all tests"
steps:
- atmos vendor pull --everything
- name: "test"
description: "Run all tests"
steps:
- atmos vendor pull --everything
116 changes: 57 additions & 59 deletions examples/demo-helmfile/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ schemas:
atmos:
manifest: "schemas/atmos-manifest.json"


templates:
settings:
enabled: true
Expand All @@ -24,7 +23,7 @@ stacks:
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_pattern: "{stage}"
name_template: "{{ .vars.stage }}"

logs:
file: "/dev/stderr"
Expand All @@ -34,61 +33,60 @@ logs:

# No arguments or flags are required
commands:
- name: "test"
description: "Run all tests"
steps:
- atmos validate stacks
- atmos helmfile apply demo -s dev

# This is equivalent to the following commands:
#- atmos helmfile generate varfile demo -s dev
#- helmfile -f components/helmfile/nginx/helmfile.yaml apply --values dev-demo.helmfile.vars.yaml

# Use Nested Custom Commands to provide easier interface for Docker Compose
- name: "k3s"
commands:
- name: "up"
description: Start k3s in the background
steps:
- |
container_running=$(docker ps -q -f "name=k3s")
if [ -n "$container_running" ]; then
echo "k3s is already running; run \`atmos k3s down\` to stop it"
else
docker compose up -d --wait
fi

- name: "down"
description: Stop k3s
steps:
- docker compose down

- name: "restart"
description: Restart k3s
- name: "test"
description: "Run all tests"
steps:
- docker compose restart

- name: "reset"
description: Reset k3s (delete all data)
steps:
- docker compose down --volumes

- name: "status"
description: Show the status of k3s
steps:
- |
container_running=$(docker ps -q -f "name=k3s")
if [ -n "$container_running" ]; then
docker compose ps --format "{{`{{.Service}} is {{.State}}`}}"
else
echo "k3s is not running; run \`atmos k3s up\` to start it"
fi

- name: "terraform"
commands:
- name: "reset"
description: Delete all local state files
steps:
- find . -type f -name "*.tfstate" -delete
- echo "Deleted all state files"

- atmos validate stacks
- atmos helmfile apply demo -s dev

# This is equivalent to the following commands:
#- atmos helmfile generate varfile demo -s dev
#- helmfile -f components/helmfile/nginx/helmfile.yaml apply --values dev-demo.helmfile.vars.yaml

# Use Nested Custom Commands to provide easier interface for Docker Compose
- name: "k3s"
commands:
- name: "up"
description: Start k3s in the background
steps:
- |
container_running=$(docker ps -q -f "name=k3s")
if [ -n "$container_running" ]; then
echo "k3s is already running; run \`atmos k3s down\` to stop it"
else
docker compose up -d --wait
fi

- name: "down"
description: Stop k3s
steps:
- docker compose down

- name: "restart"
description: Restart k3s
steps:
- docker compose restart

- name: "reset"
description: Reset k3s (delete all data)
steps:
- docker compose down --volumes

- name: "status"
description: Show the status of k3s
steps:
- |
container_running=$(docker ps -q -f "name=k3s")
if [ -n "$container_running" ]; then
docker compose ps --format "{{`{{.Service}} is {{.State}}`}}"
else
echo "k3s is not running; run \`atmos k3s up\` to start it"
fi

- name: "terraform"
commands:
- name: "reset"
description: Delete all local state files
steps:
- find . -type f -name "*.tfstate" -delete
- echo "Deleted all state files"
Loading
Loading