MON-459 update script to delete testing and incubator directories
This commit is contained in:
parent
a5421ee6a7
commit
c10a4da315
@ -5,7 +5,7 @@ source "$(dirname $0)/utils.sh"
|
|||||||
goto_root
|
goto_root
|
||||||
|
|
||||||
# loop over every monitors set
|
# loop over every monitors set
|
||||||
for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do
|
for path in $(find "$(get_scope $1)" -name 'monitors-*.tf' -print | sort -fdbi); do
|
||||||
cd $(dirname $path)
|
cd $(dirname $path)
|
||||||
# empty outputs
|
# empty outputs
|
||||||
> outputs.tf
|
> outputs.tf
|
||||||
|
|||||||
@ -10,7 +10,7 @@ sed -i '/### Monitors summary ###/q' README.md
|
|||||||
# add a newline after listing section
|
# add a newline after listing section
|
||||||
echo >> README.md
|
echo >> README.md
|
||||||
# loop over all ready monitors sets on the repo
|
# loop over all ready monitors sets on the repo
|
||||||
for path in $(find -mindepth 1 \( -path './incubator' -o -path './scripts' -o -path './testing' -o -path '*/\.*' \) -prune -o -type d -print | sort -fdbi); do
|
for path in $(find -mindepth 1 -type d ! -path '*/.*' ! -path './scripts*' -print | sort -fdbi); do
|
||||||
# split path in directories
|
# split path in directories
|
||||||
directories=($(list_dirs $path))
|
directories=($(list_dirs $path))
|
||||||
# loop over directories in path
|
# loop over directories in path
|
||||||
@ -32,7 +32,7 @@ done
|
|||||||
PATTERN_DOC="Related documentation"
|
PATTERN_DOC="Related documentation"
|
||||||
|
|
||||||
# loop over every monitors set readme
|
# loop over every monitors set readme
|
||||||
for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do
|
for path in $(find "$(get_scope $1)" -name 'monitors-*.tf' -print | sort -fdbi); do
|
||||||
cd $(dirname $path)
|
cd $(dirname $path)
|
||||||
EXIST=0
|
EXIST=0
|
||||||
if [ -f README.md ]; then
|
if [ -f README.md ]; then
|
||||||
|
|||||||
@ -7,7 +7,7 @@ goto_root
|
|||||||
root=$(basename ${PWD})
|
root=$(basename ${PWD})
|
||||||
|
|
||||||
# loop over every monitors set
|
# loop over every monitors set
|
||||||
for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do
|
for path in $(find "$(get_scope $1)" -name 'monitors-*.tf' -print | sort -fdbi); do
|
||||||
cd $(dirname $path)
|
cd $(dirname $path)
|
||||||
# get name of the monitors set directory
|
# get name of the monitors set directory
|
||||||
resource="$(basename $(dirname $path))"
|
resource="$(basename $(dirname $path))"
|
||||||
|
|||||||
@ -5,7 +5,7 @@ source "$(dirname $0)/utils.sh"
|
|||||||
goto_root
|
goto_root
|
||||||
|
|
||||||
# loop over every monitors set
|
# loop over every monitors set
|
||||||
for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do
|
for path in $(find "$(get_scope $1)" -name 'monitors-*.tf' -print | sort -fdbi); do
|
||||||
# check if there is more than 1 notify_no_data parameter set to true per set of monitors
|
# check if there is more than 1 notify_no_data parameter set to true per set of monitors
|
||||||
if [[ $(grep -c notify_no_data.*true $path) -gt 1 ]]; then
|
if [[ $(grep -c notify_no_data.*true $path) -gt 1 ]]; then
|
||||||
echo "More than one notify_no_data set to true on $path"
|
echo "More than one notify_no_data set to true on $path"
|
||||||
|
|||||||
@ -4,7 +4,7 @@ set -xueo pipefail
|
|||||||
source "$(dirname $0)/utils.sh"
|
source "$(dirname $0)/utils.sh"
|
||||||
goto_root
|
goto_root
|
||||||
|
|
||||||
for path in $(find "$(get_scope $1)" -path ./testing -prune -o -path ./incubator -prune -o -name 'inputs.tf' -print); do
|
for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do
|
||||||
dir=$(dirname ${path})
|
dir=$(dirname ${path})
|
||||||
terraform init ${dir} >> /dev/null 2>&1
|
terraform init ${dir} >> /dev/null 2>&1
|
||||||
terraform validate -check-variables=false ${dir}
|
terraform validate -check-variables=false ${dir}
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
resource "null_resource" "test-migration" {
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
terraform {
|
|
||||||
required_version = ">= 0.12"
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
variable environment {}
|
|
||||||
|
|
||||||
variable region {}
|
|
||||||
|
|
||||||
variable "critical_escalation_group" {
|
|
||||||
default = "@pagerduty_HODummy"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "warning_escalation_group" {
|
|
||||||
default = "@pagerduty_HNODummy"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "datadog_api_key" {}
|
|
||||||
variable "datadog_app_key" {}
|
|
||||||
|
|
||||||
variable "dd_system" {
|
|
||||||
default = "enabled"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "dd_aws_rds" {
|
|
||||||
default = "enabled"
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
provider "datadog" {
|
|
||||||
api_key = "${var.datadog_api_key}"
|
|
||||||
app_key = "${var.datadog_app_key}"
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
module "datadog-monitors" {
|
|
||||||
source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git"
|
|
||||||
|
|
||||||
env = "${var.environment}"
|
|
||||||
region = "${var.region}"
|
|
||||||
|
|
||||||
critical_escalation_group = "${var.critical_escalation_group}"
|
|
||||||
warning_escalation_group = "${var.warning_escalation_group}"
|
|
||||||
|
|
||||||
dd_aws_rds = "${var.dd_aws_rds}"
|
|
||||||
dd_system = "${var.dd_system}"
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user