Skip to content

Commit d7b98c5

Browse files
authored
[remote-state] Fix remote-state default output when component missing (#48)
1 parent 4edafd1 commit d7b98c5

68 files changed

Lines changed: 1274 additions & 468 deletions

Some content is hidden

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

.github/workflows/auto-context.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
- name: Create Pull Request
3737
if: steps.update.outputs.create_pull_request == 'true'
38-
uses: cloudposse/actions/github/create-pull-request@0.22.0
38+
uses: cloudposse/actions/github/create-pull-request@0.30.0
3939
with:
4040
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
4141
committer: 'cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>'

.github/workflows/auto-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
fi
6363
6464
- name: Auto Test
65-
uses: cloudposse/actions/github/repository-dispatch@0.22.0
65+
uses: cloudposse/actions/github/repository-dispatch@0.30.0
6666
# match users by ID because logins (user names) are inconsistent,
6767
# for example in the REST API Renovate Bot is `renovate[bot]` but
6868
# in GraphQL it is just `renovate`, plus there is a non-bot

.github/workflows/auto-readme.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: "auto-readme"
22
on:
3+
workflow_dispatch:
4+
35
schedule:
46
# Example of job definition:
57
# .---------------- minute (0 - 59)
@@ -15,21 +17,35 @@ on:
1517

1618
jobs:
1719
update:
18-
if: github.event_name == 'schedule'
20+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
1921
runs-on: ubuntu-latest
2022
steps:
2123
- uses: actions/checkout@v2
2224

25+
- name: Find default branch name
26+
id: defaultBranch
27+
shell: bash
28+
env:
29+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30+
run: |
31+
default_branch=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
32+
printf "::set-output name=defaultBranch::%s\n" "${default_branch}"
33+
printf "defaultBranchRef.name=%s\n" "${default_branch}"
34+
2335
- name: Update readme
2436
shell: bash
2537
id: update
2638
env:
2739
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
40+
DEF: "${{ steps.defaultBranch.outputs.defaultBranch }}"
2841
run: |
2942
make init
3043
make readme/build
3144
# Ignore changes if they are only whitespace
32-
git diff --ignore-all-space --ignore-blank-lines --quiet README.md && { git restore README.md; echo Ignoring whitespace-only changes in README; }
45+
if ! git diff --quiet README.md && git diff --ignore-all-space --ignore-blank-lines --quiet README.md; then
46+
git restore README.md
47+
echo Ignoring whitespace-only changes in README
48+
fi
3349
3450
- name: Create Pull Request
3551
# This action will not create or change a pull request if there are no changes to make.
@@ -47,7 +63,7 @@ jobs:
4763
To have most recent changes of README.md and doc from origin templates
4864
4965
branch: auto-update/readme
50-
base: main
66+
base: ${{ steps.defaultBranch.outputs.defaultBranch }}
5167
delete-branch: true
5268
labels: |
5369
auto-update

.github/workflows/chatops.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: "Handle common commands"
12-
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
12+
uses: cloudposse/actions/github/slash-command-dispatch@0.30.0
1313
with:
1414
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
1515
reaction-token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
2424
- name: "Checkout commit"
2525
uses: actions/checkout@v2
2626
- name: "Run tests"
27-
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
27+
uses: cloudposse/actions/github/slash-command-dispatch@0.30.0
2828
with:
2929
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
3030
reaction-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/validate-codeowners.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@ jobs:
1010
steps:
1111
- name: "Checkout source code at current commit"
1212
uses: actions/checkout@v2
13-
- uses: mszostok/codeowners-validator@v0.5.0
13+
- uses: mszostok/codeowners-validator@v0.7.1
1414
if: github.event.pull_request.head.repo.full_name == github.repository
1515
name: "Full check of CODEOWNERS"
1616
with:
1717
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
1818
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
1919
# checks: "files,syntax,owners,duppatterns"
2020
checks: "syntax,owners,duppatterns"
21+
owner_checker_allow_unowned_patterns: "false"
2122
# GitHub access token is required only if the `owners` check is enabled
2223
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
23-
- uses: mszostok/codeowners-validator@v0.5.0
24+
- uses: mszostok/codeowners-validator@v0.7.1
2425
if: github.event.pull_request.head.repo.full_name != github.repository
2526
name: "Syntax check of CODEOWNERS"
2627
with:
2728
checks: "syntax,duppatterns"
29+
owner_checker_allow_unowned_patterns: "false"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL := /bin/bash
33
# List of targets the `readme` target should call before generating the readme
44
export README_DEPS ?= docs/targets.md docs/terraform.md
55

6-
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)
6+
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
77

88
## Lint terraform code
99
lint:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,13 @@ Available targets:
346346
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
347347
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.0 |
348348
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.3 |
349-
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.15 |
349+
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.24 |
350350

351351
## Providers
352352

353353
| Name | Version |
354354
|------|---------|
355-
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.15 |
355+
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.24 |
356356

357357
## Modules
358358

docs/terraform.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
77
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.0 |
88
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.3 |
9-
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.15 |
9+
| <a name="requirement_utils"></a> [utils](#requirement\_utils) | >= 0.17.24 |
1010

1111
## Providers
1212

1313
| Name | Version |
1414
|------|---------|
15-
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.15 |
15+
| <a name="provider_utils"></a> [utils](#provider\_utils) | >= 0.17.24 |
1616

1717
## Modules
1818

examples/backend/atmos.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# CLI config is loaded from the following locations (from lowest to highest priority):
2+
# system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
3+
# home dir (~/.atmos)
4+
# current directory
5+
# ENV vars
6+
# Command-line arguments
7+
#
8+
# It supports POSIX-style Globs for file names/paths (double-star `**` is supported)
9+
# https://en.wikipedia.org/wiki/Glob_(programming)
10+
11+
# Base path for components, stacks and workflows configurations.
12+
# Can also be set using `ATMOS_BASE_PATH` ENV var, or `--base-path` command-line argument.
13+
# Supports both absolute and relative paths.
14+
# If not provided or is an empty string, `components.terraform.base_path`, `components.helmfile.base_path`, `stacks.base_path` and `workflows.base_path`
15+
# are independent settings (supporting both absolute and relative paths).
16+
# If `base_path` is provided, `components.terraform.base_path`, `components.helmfile.base_path`, `stacks.base_path` and `workflows.base_path`
17+
# are considered paths relative to `base_path`.
18+
base_path: "."
19+
20+
components:
21+
terraform:
22+
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_BASE_PATH` ENV var, or `--terraform-dir` command-line argument
23+
# Supports both absolute and relative paths
24+
base_path: "components/terraform"
25+
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE` ENV var
26+
apply_auto_approve: false
27+
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT` ENV var, or `--deploy-run-init` command-line argument
28+
deploy_run_init: true
29+
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE` ENV var, or `--init-run-reconfigure` command-line argument
30+
init_run_reconfigure: true
31+
# Can also be set using `ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE` ENV var, or `--auto-generate-backend-file` command-line argument
32+
auto_generate_backend_file: false
33+
helmfile:
34+
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_BASE_PATH` ENV var, or `--helmfile-dir` command-line argument
35+
# Supports both absolute and relative paths
36+
base_path: "components/helmfile"
37+
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH` ENV var
38+
kubeconfig_path: "/dev/shm"
39+
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN` ENV var
40+
helm_aws_profile_pattern: "{namespace}-{tenant}-gbl-{stage}-helm"
41+
# Can also be set using `ATMOS_COMPONENTS_HELMFILE_CLUSTER_NAME_PATTERN` ENV var
42+
cluster_name_pattern: "{namespace}-{tenant}-{environment}-{stage}-eks-cluster"
43+
44+
stacks:
45+
# Can also be set using `ATMOS_STACKS_BASE_PATH` ENV var, or `--config-dir` and `--stacks-dir` command-line arguments
46+
# Supports both absolute and relative paths
47+
base_path: "stacks"
48+
# Can also be set using `ATMOS_STACKS_INCLUDED_PATHS` ENV var (comma-separated values string)
49+
included_paths:
50+
- "**/*"
51+
# Can also be set using `ATMOS_STACKS_EXCLUDED_PATHS` ENV var (comma-separated values string)
52+
excluded_paths:
53+
- "globals/**/*"
54+
- "catalog/**/*"
55+
- "**/*globals*"
56+
# Can also be set using `ATMOS_STACKS_NAME_PATTERN` ENV var
57+
name_pattern: "{tenant}-{environment}-{stage}"
58+
59+
workflows:
60+
# Can also be set using `ATMOS_WORKFLOWS_BASE_PATH` ENV var, or `--workflows-dir` command-line arguments
61+
# Supports both absolute and relative paths
62+
base_path: "workflows"
63+
64+
logs:
65+
verbose: false
66+
colors: true

0 commit comments

Comments
 (0)