From ebbd2cc78e7bbae85deba65f5f314b273972a73b Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Lopez Date: Thu, 22 Aug 2024 18:28:47 +0200 Subject: [PATCH] Clean aws-nuke traces --- Makefile | 10 ---------- blueprints/helpers.sh | 16 ---------------- 2 files changed, 26 deletions(-) diff --git a/Makefile b/Makefile index 7885ecea..1435bc7c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ BP_AGENT_USER := bp-agent MKFILEDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) CBCI_REPO ?= https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon.git CBCI_BRANCH ?= main -NUKE_DRY_RUN ?= true DESTROY_ONLY_APPS ?= false define helpers @@ -108,15 +107,6 @@ set-cbci-location: agentCheck guard-CBCI_REPO guard-CBCI_BRANCH @$(call helpers,set-cbci-location $(CBCI_REPO) $(CBCI_BRANCH)) @$(call helpers,INFO "Setting new Casc location to $(CBCI_REPO) $(CBCI_BRANCH) finished succesfully.") -.PHONY: run-aws-nuke -run-aws-nuke: ## Run aws nuke by https://github.com/rebuy-de/aws-nuke. Example: NUKE_DRY_RUN=true make run-aws-nuke -run-aws-nuke: guard-NUKE_DRY_RUN -ifeq ($(NUKE_DRY_RUN),false) - @$(call helpers,ask-confirmation "Running AWS Nuke to destroy selected resources.") -endif - @$(call helpers,run-aws-nuke $(NUKE_DRY_RUN)) - @$(call helpers,INFO "AWS nuke finished successfully with DRY_RUN=$(NUKE_DRY_RUN).") - ########################## # Global ########################## diff --git a/blueprints/helpers.sh b/blueprints/helpers.sh index 1dd87cd5..be7bc8dc 100755 --- a/blueprints/helpers.sh +++ b/blueprints/helpers.sh @@ -206,19 +206,3 @@ set-cbci-location () { sed -i "s|bundle: \".*/none-ha\"|bundle: \"$branch/none-ha\"|g" "$SCRIPTDIR/02-at-scale/cbci/casc/oc/items/root.yaml" sed -i "s|bundle: \".*/ha\"|bundle: \"$branch/ha\"|g" "$SCRIPTDIR/02-at-scale/cbci/casc/oc/items/root.yaml" } - -run-aws-nuke () { - local dry_run="$1" - local aws_nuke_file="$SCRIPTDIR/../.cloudbees/aws-nuke/bp-tf-ci-nuke.yaml" - local aws_nuke_file_log="$SCRIPTDIR/../.cloudbees/aws-nuke/aws-nuke.log" - if [ "$dry_run" == "true" ]; then - INFO "Running AWS Nuke in Dry Run Mode..." - rm "$aws_nuke_file_log" || INFO "No log file to remove." - aws-nuke -c "$aws_nuke_file" | tee "$aws_nuke_file_log" - INFO "Listing candidated resources to be deleted by using $aws_nuke_file" - grep "remove" "$aws_nuke_file_log" || INFO "No candidates to delete." - else - WARN "Running AWS Nuke in Not Dry Run Mode..." - aws-nuke -c "$aws_nuke_file" --no-dry-run - fi -}