-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get MySQL, Mroonga, and Groonga versions automatically in update.sh #98
Changes from 1 commit
ec818f0
72aa69d
a45f415
5ee4921
71c467f
8fb581d
8b4c4f8
9414058
c1455c0
ccb6792
a9a0fea
e659536
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,42 +1,60 @@ | ||||||
#!/bin/bash | ||||||
|
||||||
set -eu | ||||||
set -eux | ||||||
|
||||||
if [ $# != 3 ]; then | ||||||
echo "Usage: $0 MYSQL_VERSION MROONGA_VERSION GROONGA_VERSION" | ||||||
echo " e.g.: $0 8.0.30 12.06 12.0.6" | ||||||
if [ $# != 0 ]; then | ||||||
echo "Usage: $0" | ||||||
exit 1 | ||||||
fi | ||||||
|
||||||
mysql_version=$1 | ||||||
mroonga_version=$2 | ||||||
groonga_version=$3 | ||||||
target_mysqls=( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry this is right. Please ignore my comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh... |
||||||
"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 | ||||||
|
||||||
case $mysql_version in | ||||||
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} | ||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might write this line outside the case block. |
||||||
;; | ||||||
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}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this debug command? If so, we could delete it. |
||||||
git commit -m "${message}" | ||||||
git tag -a -m "${message}" ${tag} | ||||||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
引数を受け取らない場合は、ここのチェックはなくても良さそうかなと思いました。