Skip to content

Commit

Permalink
Use DALMATIAN_CONFIG_PATH if set
Browse files Browse the repository at this point in the history
Update the config scripts to use DALMATIAN_CONFIG_PATH if set so that people
who override the default get the correct results.
  • Loading branch information
rjw1 committed Mar 1, 2024
1 parent e564a3c commit b44796a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/config/list-environments
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ while getopts "h" opt; do
esac
done

INFRASTRUCTURES=$(yq e -o=json ".infrastructures" "$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml")
CONFIG_FILE="${DALMATIAN_CONFIG_PATH:-$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml}"
INFRASTRUCTURES=$(yq e -o=json ".infrastructures" "$CONFIG_FILE")

if [ -z "$INFRASTRUCTURE_NAME" ]
then
Expand Down
3 changes: 2 additions & 1 deletion bin/config/list-infrastructures
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ while getopts "h" opt; do
;;
esac
done
yq e '.infrastructures | keys()' "$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml" | sed 's/^- *//g'
CONFIG_FILE="${DALMATIAN_CONFIG_PATH:-$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml}"
yq e '.infrastructures | keys()' "$CONFIG_FILE" | sed 's/^- *//g'
3 changes: 2 additions & 1 deletion bin/config/list-services
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ while getopts "h" opt; do
esac
done

INFRASTRUCTURES=$(yq e -o=json ".infrastructures" "$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml")
CONFIG_FILE="${DALMATIAN_CONFIG_PATH:-$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml}"
INFRASTRUCTURES=$(yq e -o=json ".infrastructures" "$CONFIG_FILE")

if [ -z "$INFRASTRUCTURE_NAME" ]
then
Expand Down
4 changes: 3 additions & 1 deletion bin/config/list-services-by-buildspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ then
usage
fi

INFRAS=$(yq e -o=json ".infrastructures" "$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml")
CONFIG_FILE="${DALMATIAN_CONFIG_PATH:-$APP_ROOT/bin/tmp/dalmatian-config/dalmatian.yml}"

INFRAS=$(yq e -o=json ".infrastructures" "$CONFIG_FILE")

if [ -z "$INFRASTRUCTURE_NAME" ]
then
Expand Down

0 comments on commit b44796a

Please sign in to comment.