Skip to content

Commit e2f3cd2

Browse files
authored
Merge branch 'openebs:develop' into develop
2 parents e68056b + 5c9300c commit e2f3cd2

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

scripts/release.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ helm_check() {
374374
if ! binary_check "$SEMVER"; then
375375
SEMVER=$(fetch_nix_bin "semver-tool" "semver")
376376
fi
377+
if ! binary_check "$JQ"; then
378+
JQ=$(fetch_nix_bin "jq" "jq")
379+
fi
377380
if ! binary_check "$YQ"; then
378381
YQ=$(fetch_nix_bin "yq-go" "yq")
379382
fi
@@ -653,6 +656,7 @@ SKOPEO="skopeo"
653656
ZCAT="zcat"
654657
SEMVER="semver"
655658
YQ="yq"
659+
JQ="jq"
656660
SCRIPT_DIR=$(dirname "$0")
657661
PARENT_ROOT="$(realpath -es "$(get_parent)" 2>/dev/null || :)"
658662
TAG=$(get_tag)

scripts/utils/helm.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#!/usr/bin/env bash
22

3+
JQ=${JQ:-"jq"}
4+
YQ=${YQ:-"yq"}
5+
36
helm_dep_update_required() {
47
local chart="$1"
58

6-
repository=$(echo "$chart" | jq -r '.repository')
7-
version=$(echo "$chart" | jq -r '.version')
8-
name=$(echo "$chart" | jq -r '.name')
9-
tar=$(echo "$chart" | jq -r '.tar')
9+
repository=$(echo "$chart" | $JQ -r '.repository')
10+
version=$(echo "$chart" | $JQ -r '.version')
11+
name=$(echo "$chart" | $JQ -r '.name')
12+
tar=$(echo "$chart" | $JQ -r '.tar')
1013

1114
if [ "$($SEMVER validate "$version")" != "valid" ]; then
1215
die "Found $name with version $version only pinned versions are supported!"
@@ -40,23 +43,23 @@ helm_all_deps() {
4043
fi
4144
local all_deps deps
4245

43-
if ! deps=$($HELM show chart "$chart_dir" --kubeconfig "$chart_dir/fake" | $YQ -o=json ".dependencies[]" | jq -c); then
46+
if ! deps=$($HELM show chart "$chart_dir" --kubeconfig "$chart_dir/fake" | $YQ -o=json ".dependencies[]" | $JQ -c); then
4447
log_fatal "Can't find the helm dependencies in $chart_dir"
4548
fi
4649

4750
for chart in ${deps[@]}; do
48-
repository=$(echo "$chart" | jq -r '.repository')
49-
name=$(echo "$chart" | jq -r '.name')
50-
version=$(echo "$chart" | jq -r '.version')
51+
repository=$(echo "$chart" | $JQ -r '.repository')
52+
name=$(echo "$chart" | $JQ -r '.name')
53+
version=$(echo "$chart" | $JQ -r '.version')
5154

5255
local name_rel="charts/$name"
5356
if [ -n "${repository:-}" ]; then
5457
local chart_tar="$chart_dir/$name_rel-$version.tgz"
55-
chart=$(echo "$chart" | jq -c ".tar = \"$chart_tar\"")
58+
chart=$(echo "$chart" | $JQ -c ".tar = \"$chart_tar\"")
5659

5760
if [ -n "$chart_rel" ]; then
5861
local chart_loc="$chart_dir"
59-
chart=$(echo "$chart" | jq -c ".chart = \"$chart_loc\"")
62+
chart=$(echo "$chart" | $JQ -c ".chart = \"$chart_loc\"")
6063
fi
6164

6265
if [ -n "${all_deps:-}" ]; then
@@ -116,7 +119,7 @@ helm_dep_update() {
116119
echo "Updating helm chart dependencies ..."
117120
$HELM dependency update "$chart_dir" --kubeconfig "$chart_dir/fake"
118121
while read -r chart; do
119-
chart_loc=$(echo "$chart" | jq -r '.chart')
122+
chart_loc=$(echo "$chart" | $JQ -r '.chart')
120123
if [ -n "$chart_loc" ] && [ "$chart_loc" != "null" ]; then
121124
$HELM dependency update "$chart_loc" --kubeconfig "$chart_dir/fake"
122125
fi

0 commit comments

Comments
 (0)