From 8d72f63d282c8b42839d4454311c9e091e253be2 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Wed, 22 Aug 2018 17:05:36 +0200 Subject: [PATCH] MON-293 fix pipeline --- bitbucket-pipelines.yml | 2 +- scripts/01_update_output.sh | 2 +- scripts/02_update_readme.sh | 6 +++--- scripts/03_update_module.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 28affab..fbab30c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -18,7 +18,7 @@ pipelines: script: - apk update - apk upgrade - - apk add --no-cache bash git grep + - apk add --no-cache bash git grep coreutils - go get github.com/segmentio/terraform-docs - ./scripts/auto_update.sh - git status diff --git a/scripts/01_update_output.sh b/scripts/01_update_output.sh index 4a6ad0c..a5fe989 100755 --- a/scripts/01_update_output.sh +++ b/scripts/01_update_output.sh @@ -4,7 +4,7 @@ set -xueo pipefail source "$(dirname $0)/utils.sh" goto_root -for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print); do +for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do cd $(dirname $path) > outputs.tf for monitor in $(grep 'resource "datadog_monitor"' $(basename $path) | awk '{print $3}' | tr -d '"' ); do diff --git a/scripts/02_update_readme.sh b/scripts/02_update_readme.sh index 56db16b..ea8e6a5 100755 --- a/scripts/02_update_readme.sh +++ b/scripts/02_update_readme.sh @@ -6,7 +6,7 @@ goto_root sed -i '/### Monitors summary ###/q' README.md echo >> README.md -for path in $(find -mindepth 1 \( -path './incubator' -o -path './scripts' -o -path './testing' -o -path '*/\.*' \) -prune -o -type d -print | sort); do +for path in $(find -mindepth 1 \( -path './incubator' -o -path './scripts' -o -path './testing' -o -path '*/\.*' \) -prune -o -type d -print | sort -fdbi); do directories=($(list_dirs $path)) for i in $(seq 1 $((${#directories[@]}-1))); do echo -en "\t" >> README.md @@ -20,7 +20,7 @@ done PATTERN_DOC="Related documentation" -for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print); do +for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do cd $(dirname $path) EXIST=0 if [ -f README.md ]; then @@ -53,7 +53,7 @@ Creates DataDog monitors with the following checks: EOF SAVEIFS=$IFS IFS=$(echo -en "\n\b") - for match in $(grep -E ^[[:space:]]+name[[:space:]]+= $(basename ${path})); do + for match in $(grep -E ^[[:space:]]+name[[:space:]]+= $(basename ${path}) | sort -fdbi); do name=$(get_name "${match}") echo "- ${name/could reach/forecast}" >> README.md done diff --git a/scripts/03_update_module.sh b/scripts/03_update_module.sh index c5adb5f..e4415b3 100755 --- a/scripts/03_update_module.sh +++ b/scripts/03_update_module.sh @@ -4,7 +4,7 @@ set -xueo pipefail source "$(dirname $0)/utils.sh" goto_root -for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print); do +for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print | sort -fdbi); do cd $(dirname $path) resource="$(basename $(dirname $path))" if ! [ -f modules.tf ] && grep -q filter_tags_use_defaults inputs.tf; then