@@ -28,40 +28,43 @@ FILE_TO_UPDATE_HELM_CHART_VERSION=(
28
28
)
29
29
30
30
usage () {
31
- echo " Usage: $0 <ic_version > <helm_chart_version >"
31
+ echo " Usage: $0 <current_ic_version > <current_helm_chart_version> <new_ic_version> <new_helm_chart_version >"
32
32
exit 1
33
33
}
34
34
35
- if ! command -v yq > /dev/null 2>&1 ; then
36
- echo " ERROR: yq command not found in \$ PATH, cannot continue, exiting..."
37
- exit 2
35
+ current_ic_version=$1
36
+ current_helm_chart_version=$2
37
+ new_ic_version=$3
38
+ new_helm_chart_version=$4
39
+
40
+ if [ -z " ${current_ic_version} " ]; then
41
+ usage
38
42
fi
39
43
40
- ic_version=$1
41
- helm_chart_version=$2
44
+ if [ -z " ${current_helm_chart_version} " ]; then
45
+ usage
46
+ fi
42
47
43
- if [ -z " ${ic_version } " ]; then
48
+ if [ -z " ${new_ic_version } " ]; then
44
49
usage
45
50
fi
46
51
47
- if [ -z " ${helm_chart_version } " ]; then
52
+ if [ -z " ${new_helm_chart_version } " ]; then
48
53
usage
49
54
fi
50
55
51
- current_ic_version=$( yq ' .appVersion' < " ${HELM_CHART_PATH} /Chart.yaml" )
52
56
escaped_current_ic_version=$( printf ' %s' " $current_ic_version " | sed -e ' s/\./\\./g' ) ;
53
- current_helm_chart_version=$( yq ' .version' < " ${HELM_CHART_PATH} /Chart.yaml" )
54
57
escaped_current_helm_chart_version=$( printf ' %s' " $current_helm_chart_version " | sed -e ' s/\./\\./g' ) ;
55
58
56
59
echo " Updating versions: "
57
- echo " ic_version: ${current_ic_version} -> ${ic_version } "
58
- echo " helm_chart_version: ${current_helm_chart_version} -> ${helm_chart_version } "
60
+ echo " ic_version: ${current_ic_version} -> ${new_ic_version } "
61
+ echo " helm_chart_version: ${current_helm_chart_version} -> ${new_helm_chart_version } "
59
62
60
- regex_ic=" s#$escaped_current_ic_version #$ic_version #g"
61
- regex_helm=" s#$escaped_current_helm_chart_version #$helm_chart_version #g"
63
+ regex_ic=" s#$escaped_current_ic_version #$new_ic_version #g"
64
+ regex_helm=" s#$escaped_current_helm_chart_version #$new_helm_chart_version #g"
62
65
63
66
mv " ${HELM_CHART_PATH} /values.schema.json" " ${TMPDIR} /"
64
- jq --arg version " ${ic_version } " \
67
+ jq --arg version " ${new_ic_version } " \
65
68
' .properties.controller.properties.image.properties.tag.default = $version | .properties.controller.properties.image.properties.tag.examples[0] = $version | .properties.controller.examples[0].image.tag = $version | .properties.controller.properties.image.examples[0].tag = $version | .examples[0].controller.image.tag = $version' \
66
69
${TMPDIR} /values.schema.json \
67
70
> " ${HELM_CHART_PATH} /values.schema.json"
0 commit comments