From 58befe512240448cd78414cdf427ef42f8331c48 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Lopez Date: Fri, 8 Nov 2024 20:18:58 +0100 Subject: [PATCH] adding large-runners --- .github/workflows/md-link-checker.yml | 3 ++- .github/workflows/release-drafter.yml | 3 ++- .github/workflows/superlinter.yml | 3 ++- .github/workflows/terraform-docs.yml | 3 ++- .github/workflows/terraform.yml | 9 ++++++--- blueprints/helpers.sh | 6 +++--- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/md-link-checker.yml b/.github/workflows/md-link-checker.yml index b5250d46..6ac2fb7b 100644 --- a/.github/workflows/md-link-checker.yml +++ b/.github/workflows/md-link-checker.yml @@ -9,7 +9,8 @@ on: jobs: check-links: name: MD_Check_Links - runs-on: ubuntu-latest + runs-on: + group: large-runners steps: - uses: actions/checkout@v3 - uses: gaurav-nelson/github-action-markdown-link-check@v1 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 1050defd..d13f36c2 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -28,7 +28,8 @@ jobs: # write permission is required for autolabeler # otherwise, read permission is required at least pull-requests: write - runs-on: ubuntu-latest + runs-on: + group: large-runners steps: # (Optional) GitHub Enterprise requires GHE_HOST variable set #- name: Set GHE_HOST diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml index fc93b598..b139b8be 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/superlinter.yml @@ -9,7 +9,8 @@ on: jobs: superlinter: name: Super_Linter - runs-on: ubuntu-latest + runs-on: + group: large-runners steps: - name: Checkout Repository uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 diff --git a/.github/workflows/terraform-docs.yml b/.github/workflows/terraform-docs.yml index c45d67db..90425858 100644 --- a/.github/workflows/terraform-docs.yml +++ b/.github/workflows/terraform-docs.yml @@ -13,7 +13,8 @@ on: jobs: docs: name: Terraform_Docs - runs-on: ubuntu-latest + runs-on: + group: large-runners steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 with: diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 2887491e..0d1c3ded 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -22,7 +22,8 @@ concurrency: jobs: collectInputs: name: Collect workflow inputs - runs-on: ubuntu-latest + runs-on: + group: large-runners outputs: directories: ${{ steps.dirs.outputs.directories }} steps: @@ -36,7 +37,8 @@ jobs: preCommitMinVersions: name: Min TF pre-commit needs: collectInputs - runs-on: ubuntu-latest + runs-on: + group: large-runners strategy: matrix: directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} @@ -82,7 +84,8 @@ jobs: preCommitMaxVersion: name: Max TF pre-commit - runs-on: ubuntu-latest + runs-on: + group: large-runners needs: collectInputs steps: - name: Remove default Terraform diff --git a/blueprints/helpers.sh b/blueprints/helpers.sh index 0bbba69f..2f5865dc 100755 --- a/blueprints/helpers.sh +++ b/blueprints/helpers.sh @@ -99,12 +99,12 @@ tf-destroy () { export TF_LOG_PATH="$SCRIPTDIR/$root/terraform.log" rm "$TF_LOG_PATH" || INFO "No previous log found." tf-destroy-wl "$root" + eks_cluster_name=$(tf-output "$root" eks_cluster_name) + aws_region=$(tf-output "$root" aws_region) retry 3 "terraform -chdir=$SCRIPTDIR/$root destroy -target=module.eks -auto-approve" INFO "Destroy target module.eks completed." #Prevent Issue #165 - if [ "$root" == "${BLUEPRINTS[1]}" ]; then - eks_cluster_name=$(tf-output "$root" eks_cluster_name) - aws_region=$(tf-output "$root" aws_region) + if [ "$root" == "${BLUEPRINTS[1]}" ] && [ -n "$eks_cluster_name" ] && [ -n "$aws_region" ]; then bash "$SCRIPTDIR/$root/k8s/kube-prom-destroy.sh" "$eks_cluster_name" "$aws_region" INFO "kube-prom-destroy.sh completed." fi