1
1
#! /usr/bin/env bash
2
2
3
+ SCRIPTDIR=" $( dirname " $( realpath " ${BASH_SOURCE[0]:- " $0 " } " ) " ) "
4
+ ROOTDIR=" $SCRIPTDIR /../.."
5
+
6
+ source " $ROOTDIR /scripts/utils/yaml.sh"
7
+ source " $ROOTDIR /scripts/utils/repo.sh"
8
+
3
9
# On a new appTag, update the Chart.yaml which is used to publish the chart to the appropriate
4
10
# version and appVersion.
5
11
# For this first iteration version and appVersion in the Chart.yaml *MUST* point to the stable
@@ -24,46 +30,12 @@ die()
24
30
25
31
set -euo pipefail
26
32
27
- # This uses the existing remote refs for the openebs/mayastor-extensions repo to find the latest 'release/x.y' branch.
28
- # Requires a 'git fetch origin' (origin being the remote entry for openebs/mayastor-extensions) or equivalent, if not
29
- # done already.
30
- latest_release_branch () {
31
- if [ -n " $LATEST_RELEASE_BRANCH " ]; then
32
- echo " $LATEST_RELEASE_BRANCH "
33
- return 0
34
- fi
35
-
36
- cd " $ROOTDIR "
37
-
38
- # The latest release branch name is required for generating the helm chart version/appVersion
39
- # for the 'main' branch only.
40
- # The 'git branch' command in the below lines checks remote refs for release/x.y branch entries.
41
- # Because the 'main' branch is not a significant branch for a user/contributor, this approach towards
42
- # finding the latest release branch assumes that this script is used when the 'openebs/mayastor-extensions'
43
- # repo is present amongst git remote refs. This happens automatically when the 'openebs/mayastor-extensions'
44
- # repo is cloned, and not a user/contributor's fork.
45
- local latest_release_branch=$( git branch \
46
- --all \
47
- --list " origin/release/*.*" \
48
- --format ' %(refname:short)' \
49
- --sort ' refname' \
50
- | tail -n 1)
51
-
52
- if [ " $latest_release_branch " == " " ]; then
53
- latest_release_branch=" origin/release/0.0"
54
- fi
55
-
56
- cd - > /dev/null
57
-
58
- echo " ${latest_release_branch#* origin/ } "
59
- }
60
-
61
33
helm_testing_branch_version () {
62
34
local release_branch=$1
63
35
local helm_kind=" "
64
36
65
37
if [[ " $check_branch " == " helm-testing/develop" ]]; then
66
- release_branch=$( latest_release_branch)
38
+ release_branch=$( latest_release_branch " origin " )
67
39
helm_kind=" main"
68
40
elif [[ " $check_branch " =~ ^helm-testing\/ release\/ [0-9.]+$ ]]; then
69
41
release_branch=" ${check_branch# helm-testing/ } "
@@ -203,22 +175,6 @@ index_yaml()
203
175
fi
204
176
}
205
177
206
- # yq-go eats up blank lines
207
- # this function gets around that using diff with --ignore-blank-lines
208
- yq_ibl ()
209
- {
210
- set +e
211
- diff_out=$( diff -B <( yq ' .' " $2 " ) <( yq " $1 " " $2 " ) )
212
- error=$?
213
- if [ " $error " != " 0" ] && [ " $error " != " 1" ]; then
214
- exit " $error "
215
- fi
216
- if [ -n " $diff_out " ]; then
217
- echo " $diff_out " | patch --quiet --no-backup-if-mismatch " $2 " -
218
- fi
219
- set -euo pipefail
220
- }
221
-
222
178
output_yaml ()
223
179
{
224
180
newChartVersion=$1
@@ -272,8 +228,6 @@ Examples:
272
228
EOF
273
229
}
274
230
275
- SCRIPTDIR=" $( dirname " $( realpath " ${BASH_SOURCE[0]:- " $0 " } " ) " ) "
276
- ROOTDIR=" $SCRIPTDIR /../.."
277
231
CHART_FILE=${CHART_FILE:- " $ROOTDIR /chart/Chart.yaml" }
278
232
CHART_VALUES=${CHART_VALUES:- " $ROOTDIR /chart/values.yaml" }
279
233
CHART_DOC=${CHART_DOC:- " $ROOTDIR /chart/doc.yaml" }
0 commit comments