-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollect.sh
More file actions
executable file
·25 lines (21 loc) · 699 Bytes
/
collect.sh
File metadata and controls
executable file
·25 lines (21 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
set -uo pipefail
# Collect data for all modules
failed_modules=()
modules=$(gh repo list terraform-aws-modules --source --limit 100 --json name --jq '.[].name' | \
grep terraform-aws- | \
grep -v s3-object | \
sed 's/terraform-aws-//g')
for module in $modules; do
if ! target/release/tmd collect-data --module "$module"; then
echo "WARNING: Failed to collect data for module: $module" >&2
failed_modules+=("$module")
fi
done
# Update graphs
target/release/tmd graph
# Report failures
if [ ${#failed_modules[@]} -gt 0 ]; then
echo "WARNING: Failed to collect data for ${#failed_modules[@]} module(s):" >&2
printf ' - %s\n' "${failed_modules[@]}" >&2
fi