-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new helper scripts for parsing YAML files
- Loading branch information
Martin Jackson
committed
Dec 12, 2023
1 parent
2c4703a
commit df0ccb4
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
PATTERN_DIR="$1" | ||
|
||
if [ -z "$PATTERN_DIR" ]; then | ||
PATTERN_DIR="." | ||
fi | ||
|
||
CGNAME=$(yq '.main.clusterGroupName' "$PATTERN_DIR/values-global.yaml") | ||
|
||
if [ -z "$CGNAME" ] || [ "$CGNAME" == "null" ]; then | ||
echo "Error - cannot detrmine clusterGroupName" | ||
exit 1 | ||
fi | ||
|
||
echo "$CGNAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
PATTERN_DIR="$1" | ||
|
||
if [ -z "$PATTERN_DIR" ]; then | ||
PATTERN_DIR="." | ||
fi | ||
|
||
PATNAME=$(yq '.global.pattern' "$PATTERN_DIR/values-global.yaml" 2>/dev/null) | ||
|
||
if [ -z "$PATNAME" ] || [ "$PATNAME" == "null" ]; then | ||
PATNAME="$(basename "$PWD")" | ||
fi | ||
|
||
echo "$PATNAME" |