From 5e8778701ee5af85a7b977f239bf4152c8499249 Mon Sep 17 00:00:00 2001 From: David Cheung Date: Fri, 25 Sep 2020 21:26:39 -0400 Subject: [PATCH 1/2] chore: add lint status badge to readme --- .github/workflows/terraform.yml | 22 ++++++++++++++++------ README.md | 2 ++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 8acb3a9..d2895a4 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -34,21 +34,31 @@ jobs: run: | cd ${GITHUB_WORKSPACE}/temp-project zero create - - name: Terraform Init and Validate - id: init_and_validate + - name: Set validation targets + id: set_validation_targets run: | INFRA_DIR=${GITHUB_WORKSPACE}/temp-project/infrastructure + ## Defining test targets per line, last line ends with double quote - TERRAFORM_TEST_TARGETS="${INFRA_DIR}/terraform/bootstrap/remote-state + echo "${INFRA_DIR}/terraform/bootstrap/remote-state ${INFRA_DIR}/terraform/bootstrap/secrets ${INFRA_DIR}/terraform/environments/stage ${INFRA_DIR}/terraform/environments/prod ${INFRA_DIR}/kubernetes/terraform/environments/stage - ${INFRA_DIR}/kubernetes/terraform/environments/prod" - - for dir in $TERRAFORM_TEST_TARGETS; do + ${INFRA_DIR}/kubernetes/terraform/environments/prod" > ${GITHUB_WORKSPACE}/validation-targets.conf + - name: Terraform Init + id: terraform_init + run: | + for dir in $(cat ${GITHUB_WORKSPACE}/validation-targets.conf); do echo "Linting ${dir}" cd $dir terraform init -backend=false + done + - name: Terraform Validate + id: terraform_validate + run: | + for dir in $(cat ${GITHUB_WORKSPACE}/validation-targets.conf); do + echo "Validating ${dir}" + cd $dir terraform validate -no-color done diff --git a/README.md b/README.md index eaeae27..b7d72a4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Overview +[![Validation Status](https://github.com/commitdev/zero-aws-eks-stack/workflows/Validate%20Terraform/badge.svg)](https://github.com/commitdev//zero-aws-eks-stack/actions) + A set of templates meant to work with [Zero], the templated result is a ready to scale infrastructure boilerplate built on top of AWS EKS baked with all best practices we have accumulated. ## Repository structure From f9209cc6817400bd315508fdd0fd51affc7255a4 Mon Sep 17 00:00:00 2001 From: David Cheung Date: Mon, 28 Sep 2020 15:43:47 -0400 Subject: [PATCH 2/2] fix extra slash typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7d72a4..b49d898 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Overview -[![Validation Status](https://github.com/commitdev/zero-aws-eks-stack/workflows/Validate%20Terraform/badge.svg)](https://github.com/commitdev//zero-aws-eks-stack/actions) +[![Validation Status](https://github.com/commitdev/zero-aws-eks-stack/workflows/Validate%20Terraform/badge.svg)](https://github.com/commitdev/zero-aws-eks-stack/actions) A set of templates meant to work with [Zero], the templated result is a ready to scale infrastructure boilerplate built on top of AWS EKS baked with all best practices we have accumulated.