forked from mroonga/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·45 lines (37 loc) · 914 Bytes
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -eu
if [ $# != 3 ]; then
echo "Usage: $0 MYSQL_VERSION MROONGA_VERSION GROONGA_VERSION"
echo " e.g.: $0 5.7.26 9.01 9.0.2"
exit 1
fi
mysql_version=$1
mroonga_version=$2
groonga_version=$3
if type gsed > /dev/null 2>&1; then
SED=gsed
else
SED=sed
fi
case $mysql_version in
5.7.*)
docker_file=mysql-5.7/Dockerfile
;;
8.0.*)
docker_file=mysql-8.0/Dockerfile
;;
esac
${SED} \
-i'' \
-r \
-e "s/mysql:[0-9.]*/mysql:${mysql_version}/g" \
-e "s/mroonga_version=[0-9.]*/mroonga_version=${mroonga_version}/g" \
-e "s/groonga_version=[0-9.]*/groonga_version=${groonga_version}/g" \
${docker_file}
git add ${docker_file}
ruby "$(dirname "$0")/update-tag-list.rb" "$@"
git add README.md
tag="mysql-${mysql_version}-${mroonga_version}"
message="MySQL ${mysql_version} and Mroonga ${mroonga_version}"
git commit -m "${message}"
git tag -a -m "${message}" ${tag}