forked from mroonga/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·60 lines (51 loc) · 1.6 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -eux
if [ $# != 0 ]; then
echo "Usage: $0"
exit 1
fi
target_mysqls=(
"8.0"
"8.4"
)
mroonga_version=$(curl https://api.github.com/repos/mroonga/mroonga/releases/latest \
| jq -r '.["tag_name"]' | sed 's/^v//')
groonga_version=$(curl https://api.github.com/repos/groonga/groonga/releases/latest \
| jq -r '.["tag_name"]' | sed 's/^v//')
if type gsed > /dev/null 2>&1; then
SED=gsed
else
SED=sed
fi
for target_mysql in "${target_mysqls[@]}"; do
case $target_mysql in
8.0)
mysql_version=$(curl https://raw.githubusercontent.com/docker-library/mysql/refs/heads/master/versions.json \
| jq -r '.["8.0"]["version"]')
docker_file=mysql-8.0/Dockerfile
;;
8.4)
mysql_version=$(curl https://raw.githubusercontent.com/docker-library/mysql/refs/heads/master/versions.json \
| jq -r '.["8.4"]["version"]')
docker_file=mysql-8.4/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" \
"${mysql_version}" \
"${mroonga_version}" \
"${groonga_version}"
git add README.md
tag="mysql-${mysql_version}-${mroonga_version}"
message="MySQL ${mysql_version} and Mroonga ${mroonga_version}"
echo "${message}"
git commit -m "${message}"
git tag -a -m "${message}" ${tag}
done