Skip to content

Commit

Permalink
Imports for overrides (#831)
Browse files Browse the repository at this point in the history
* updates

* updates

* updates

* updates

* updates
  • Loading branch information
aknysh authored Dec 9, 2024
1 parent d6d0ff7 commit 73c8c49
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 111 deletions.
4 changes: 2 additions & 2 deletions atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ base_path: "."
vendor:
# Path to vendor configuration file or directory containing vendor files
# Supports both absolute and relative paths
# If a directory is specified, all .yaml files in the directory will be processed in lexicographical order
# If a directory is specified, all `.yaml` and `.yaml` files in the directory will be processed in lexicographical order
# Can also be set using 'ATMOS_VENDOR_BASE_PATH' ENV var, or '--vendor-base-path' command-line argument
# Examples:
# base_path: "./vendor.yaml" # Single file
# base_path: "./vendor.d/" # Directory containing multiple .yaml files
# base_path: "./vendor.d/" # Directory containing multiple vendor configuration files
base_path: "./vendor.yaml"

components:
Expand Down
2 changes: 1 addition & 1 deletion examples/quick-start-advanced/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG GEODESIC_OS=debian
# https://atmos.tools/
# https://github.com/cloudposse/atmos
# https://github.com/cloudposse/atmos/releases
ARG ATMOS_VERSION=1.118.0
ARG ATMOS_VERSION=1.121.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.5.7
Expand Down
40 changes: 40 additions & 0 deletions examples/tests/stacks/teams/testing-overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json

# Global overrides
# Override the variables, env, command and settings ONLY in the components managed by the `testing` Team.
overrides:
env:
# This ENV variable will be added or overridden in all the components managed by the `testing` Team
TEST_ENV_VAR1: "test-env-var1-overridden"
settings: {}
vars: {}

# Terraform overrides
# Override the variables, env, command and settings ONLY in the Terraform components managed by the `testing` Team.
# The Terraform `overrides` are deep-merged with the global `overrides`
# and takes higher priority (it will override the same keys from the global `overrides`).
terraform:
overrides:
settings:
spacelift:
# All the components managed by the `testing` Team will have the Spacelift stacks auto-applied
# if the planning phase was successful and there are no plan policy warnings
# https://docs.spacelift.io/concepts/stack/stack-settings#autodeploy
autodeploy: true
vars:
# This variable will be added or overridden in all the Terraform components managed by the `testing` Team
test_1: 1
# The `testing` Team uses `tofu` instead of `terraform`
# https://opentofu.org
# The commands `atmos terraform <sub-command> ...` will execute the `tofu` binary
command: tofu

# Helmfile overrides
# Override the variables, env, command and settings ONLY in the Helmfile components managed by the `testing` Team.
# The Helmfile `overrides` are deep-merged with the global `overrides`
# and takes higher priority (it will override the same keys from the global `overrides`).
helmfile:
overrides:
env:
# This ENV variable will be added or overridden in all the Helmfile components managed by the `testing` Team
TEST_ENV_VAR2: "test-env-var2-overridden"
32 changes: 15 additions & 17 deletions examples/tests/stacks/teams/testing.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json

import:
# The `testing` Team manages all the components defined in the following stack manifests:
# The `testing` Team manages all the components defined in this stack manifest and imported from the catalog
- catalog/terraform/test-component-2
# The `overrides` in `teams/testing-overrides` will affect all the components in this stack manifest
# and all the components that are imported AFTER the `overrides` from `teams/testing-overrides`.
# It will affect the components imported from `catalog/terraform/test-component-2`.
# The `overrides` defined in this manifest will affect all the imported components, including `catalog/terraform/test-component-2`.
- teams/testing-overrides
- catalog/terraform/test-component
- catalog/terraform/test-component-override

# Global overrides.
# The `overrides` in this stack manifest take precedence over the `overrides` imported from `teams/testing-overrides`

# Global overrides
# Override the variables, env, command and settings ONLY in the components managed by the `testing` Team.
overrides:
env:
# This ENV variable will be added or overridden in all the components managed by the `testing` Team
TEST_ENV_VAR1: "test-env-var1-overridden"
TEST_ENV_VAR1: "test-env-var1-overridden-2"
settings: {}
vars: {}

# Terraform overrides.
# Terraform overrides
# Override the variables, env, command and settings ONLY in the Terraform components managed by the `testing` Team.
# The Terraform `overrides` are deep-merged with the global `overrides`
# and takes higher priority (it will override the same keys from the global `overrides`).
terraform:
overrides:
settings:
spacelift:
# All the components managed by the `testing` Team will have the Spacelift stacks auto-applied
# if the planning phase was successful and there are no plan policy warnings
# https://docs.spacelift.io/concepts/stack/stack-settings#autodeploy
autodeploy: true
vars:
# This variable will be added or overridden in all the Terraform components managed by the `testing` Team
test_1: 1
# The `testing` Team uses `tofu` instead of `terraform`
# https://opentofu.org
# The commands `atmos terraform <sub-command> ...` will execute the `tofu` binary
command: tofu
test_1: 2

# Helmfile overrides.
# Helmfile overrides
# Override the variables, env, command and settings ONLY in the Helmfile components managed by the `testing` Team.
# The Helmfile `overrides` are deep-merged with the global `overrides`
# and takes higher priority (it will override the same keys from the global `overrides`).
helmfile:
overrides:
env:
# This ENV variable will be added or overridden in all the Helmfile components managed by the `testing` Team
TEST_ENV_VAR2: "test-env-var2-overridden"
TEST_ENV_VAR2: "test-env-var2-overridden-2"
Loading

0 comments on commit 73c8c49

Please sign in to comment.