Skip to content

Commit bbef734

Browse files
authored
feat: CI Bot bump chart version along with new deploy image version (#2028)
* Update appVersion for next deploy [skip ci] * Bump the chart version along with image version Signed-off-by: Viet Nguyen Duc <[email protected]> --------- Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent c3938aa commit bbef734

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

charts/selenium-grid/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: selenium-grid
33
description: A Helm chart for creating a Selenium Grid Server in Kubernetes
44
type: application
55
version: 0.25.1
6-
appVersion: 4.15.0-20231110
6+
appVersion: 4.15.0-20231122
77
icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png
88
dependencies:
99
- repository: https://kedacore.github.io/charts

update_tag_in_docs_and_files.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,45 @@ LATEST_TAG=$1
44
NEXT_TAG=$2
55
LATEST_DATE=$(echo ${LATEST_TAG} | sed 's/.*-//')
66
NEXT_DATE=$(echo ${NEXT_TAG} | sed 's/.*-//')
7+
latest_chart_app_version=$(find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 cat | grep ^appVersion | cut -d ':' -f 2 | tr -d '[:space:]')
78

89
echo -e "\033[0;32m Updating tag displayed in docs and files...\033[0m"
910
echo -e "\033[0;32m LATEST_TAG -> ${LATEST_TAG}\033[0m"
1011
echo -e "\033[0;32m NEXT_TAG -> ${NEXT_TAG}\033[0m"
1112

1213
# If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`.
13-
find . \( -type d -name .git -prune \) -o -type f ! -name 'Chart.yaml' -print0 | xargs -0 sed -i "s/${LATEST_TAG}/${NEXT_TAG}/g"
14+
find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/${LATEST_TAG}/${NEXT_TAG}/g"
1415

1516
echo -e "\033[0;32m Updating date used in some docs and files...\033[0m"
1617
echo -e "\033[0;32m LATEST_DATE -> ${LATEST_DATE}\033[0m"
1718
echo -e "\033[0;32m NEXT_DATE -> ${NEXT_DATE}\033[0m"
1819

1920
# If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`.
20-
find . \( -type d -name .git -prune \) -o -type f ! -name 'Chart.yaml' -print0 | xargs -0 sed -i "s/${LATEST_DATE}/${NEXT_DATE}/g"
21+
find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/${LATEST_DATE}/${NEXT_DATE}/g"
22+
23+
# Bump chart version and appVersion if next tag is different
24+
if [ "$latest_chart_app_version" == $LATEST_TAG ] && [ "$latest_chart_app_version" != "$NEXT_TAG" ]; then
25+
IFS='.' read -ra latest_version_parts <<< "$LATEST_TAG"
26+
IFS='.' read -ra next_version_parts <<< "$NEXT_TAG"
27+
latest_chart_version=$(find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 cat | grep ^version | cut -d ':' -f 2 | tr -d '[:space:]')
28+
IFS='.' read -ra latest_chart_version_parts <<< "$latest_chart_version"
29+
if [ "${latest_version_parts[0]}" != "${next_version_parts[0]}" ]; then
30+
((latest_chart_version_parts[0]++))
31+
latest_chart_version_parts[1]=0
32+
latest_chart_version_parts[2]=0
33+
elif [ "${latest_version_parts[1]}" != "${next_version_parts[1]}" ]; then
34+
((latest_chart_version_parts[1]++))
35+
latest_chart_version_parts[2]=0
36+
elif [ "${latest_version_parts[2]}" != "${next_version_parts[2]}" ]; then
37+
((latest_chart_version_parts[2]++))
38+
fi
39+
next_chart_version="${latest_chart_version_parts[0]}.${latest_chart_version_parts[1]}.${latest_chart_version_parts[2]}"
40+
echo -e "\033[0;32m Updating chart version...\033[0m"
41+
echo -e "\033[0;32m LATEST_CHART_VERSION -> ${latest_chart_version}\033[0m"
42+
echo -e "\033[0;32m NEXT_CHART_VERSION -> ${next_chart_version}\033[0m"
43+
# If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`.
44+
find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 sed -i "s/${latest_chart_version}/${next_chart_version}/g"
45+
fi
2146

2247
git diff | cat
2348

0 commit comments

Comments
 (0)