Skip to content

Commit f155d23

Browse files
ci(action,PVQ-4861): Fix that in README is latest docker tag instead of "latest" tag that does not exists for any of our docker images.
1 parent 8618e26 commit f155d23

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

update_version.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ if [ "$1" == "latest" ]; then
1717
exit 0
1818
fi
1919

20+
version=$1
21+
22+
echo "Version: ${version}"
23+
24+
25+
# config.json
2026
# Check if config.json exists
2127
if [ ! -f "config.json" ]; then
2228
echo "File config.json does not exist."
@@ -25,11 +31,24 @@ fi
2531

2632
# Replace in config.json in "version" : "v0.0.0"
2733
# "v0.0.0" in with the provided argument
28-
sed -i "s|v0\.0\.0|$1|g" config.json
34+
sed -i.bak "s|v0\.0\.0|${version}|g" config.json && rm config.json.bak
2935

30-
echo "Replaced all occurrences of 'v0.0.0' with '$1' in config.json."
36+
echo "Replaced all occurrences of 'v0.0.0' with '${version}' in config.json."
3137

3238
# Replace "latest" with the provided argument in config.json
33-
sed -i "s|latest|$1|g" config.json
39+
sed -i.bak "s|latest|${version}|g" config.json && rm config.json.bak
40+
41+
echo "Replaced all occurrences of 'latest' with '${version}' in config.json."
42+
43+
44+
# README.md
45+
# Check if README.md exists
46+
if [ ! -f "README.md" ]; then
47+
echo "File README.md does not exist."
48+
exit 1
49+
fi
50+
51+
# Replace "latest" with the provided argument in README.md
52+
sed -i.bak "s/:latest/:${version}/g" README.md && rm README.md.bak
3453

35-
echo "Replaced all occurrences of 'latest' with '$1' in config.json."
54+
echo "Replaced all occurrences of 'latest' with '${version}' in README.md."

0 commit comments

Comments
 (0)