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

Generalization of tflint call for FAST stages #2225

Merged
merged 8 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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: 8 additions & 13 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,14 @@ jobs:

- name: TFLint FAST
run: |
# TODO: try to generalize this
tflint --chdir fast/stages/0-bootstrap --var-file ../../../tests/fast/stages/s0_bootstrap/simple.tfvars
tflint --chdir fast/stages/1-resman --var-file ../../../tests/fast/stages/s1_resman/simple.tfvars
tflint --chdir fast/stages/2-networking-a-peering --var-file ../../../tests/fast/stages/s2_networking_a_peering/common.tfvars
tflint --chdir fast/stages/2-networking-b-vpn --var-file ../../../tests/fast/stages/s2_networking_b_vpn/common.tfvars
tflint --chdir fast/stages/2-networking-c-nva --var-file ../../../tests/fast/stages/s2_networking_c_nva/common.tfvars
tflint --chdir fast/stages/2-networking-d-separate-envs --var-file ../../../tests/fast/stages/s2_networking_d_separate_envs/common.tfvars
tflint --chdir fast/stages/2-security --var-file ../../../tests/fast/stages/s2_security/common.tfvars
tflint --chdir fast/stages/3-data-platform/dev --var-file ../../../../tests/fast/stages/s3_data_platform/common.tfvars
tflint --chdir fast/stages/3-gcve/prod/ --var-file ../../../../tests/fast/stages/s3_gcve_minimal/simple.tfvars
tflint --chdir fast/stages/3-data-platform/dev --var-file ../../../../tests/fast/stages/s3_data_platform/common.tfvars
tflint --chdir fast/stages/3-gke-multitenant/dev --var-file ../../../../tests/fast/stages/s3_gke_multitenant/common.tfvars
tflint --chdir fast/stages/3-project-factory/dev --var-file ../../../../tests/fast/stages/s3_project_factory/common.tfvars
for STAGE_DIR in $(find fast/stages -name main.tf -printf '%h\n' ) ; do
STAGE_NAME=$(echo ${STAGE_DIR} | sed -e 's#^fast/stages/\([^/]*\)[/]\?.*$#\1#')
VAR_PATH_LEVEL="."
if [ -z $(echo ${STAGE_DIR} | sed -e 's#^fast/stages/[^/]*/\(.*\)$##') ] ; then
VAR_PATH_LEVEL=".."
fi
tflint --chdir ${STAGE_DIR} --var-file ${VAR_PATH_LEVEL}/../../../tests/fast/stages/s$(echo ${STAGE_NAME} | sed -e 's/-/_/g')/common.tfvars
done

- name: Check documentation
id: documentation-fabric
Expand Down
2 changes: 1 addition & 1 deletion tests/fast/stages/s0_bootstrap/tftest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tests:
- checklist.yaml
simple:
tfvars:
- simple.tfvars
- common.tfvars
inventory:
- simple.yaml
- simple_projects.yaml
Expand Down
2 changes: 1 addition & 1 deletion tests/fast/stages/s1_resman/tftest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ tests:
- checklist.yaml
simple:
tfvars:
- simple.tfvars
- common.tfvars
inventory:
- simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ module: fast/stages/3-gcve/prod
tests:
simple:
tfvars:
- simple.tfvars
- common.tfvars
inventory:
- simple.yaml
Loading