diff --git a/tools/update-pgroonga-upgrade-page.sh b/tools/update-pgroonga-upgrade-page.sh new file mode 100755 index 000000000..fbe67748e --- /dev/null +++ b/tools/update-pgroonga-upgrade-page.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -eu + +if [ $# -ne 1 ] && [ $# -ne 2 ]; then + echo "USAGE: ./update-pgroonga-upgrade-page.sh compatible" + echo "or" + echo "USAGE: ./update-pgroonga-upgrade-page.sh incompatible \"a reason of incompatible\"" + exit 1 +fi + +COMPATIBLE_OR_NOT=$1 + +git clone git@github.com:pgroonga/pgroonga.git +pushd pgroonga +LATEST_VERSION=$(git tag --sort version:refname | tail -n 2 | sed -n '2p') +PREVIOUS_VERSION=$(git tag --sort version:refname | tail -n 2 | sed -n '1p') +popd +rm -rf pgroonga + +cd ../ + +if [ $COMPATIBLE_OR_NOT = "compatible" ]; then + cat < $LATEST_VERSION: o +CONTENTS +else + set +u + INCOMPATIBLE_REASON=$2 + set -u + cat < $LATEST_VERSION: x + + * $INCOMPATIBLE_REASON +CONTENTS +fi + +# TODO: I'll remove translation. +# Because contents of this page doesn't need to translate. +rake jekyll:i18n:translate +git add _po/ja/upgrade/index.po +git add ja/upgrade/index.md +git add upgrade/index.md + +git commit -m "upgrade: add $PREVIOUS_VERSION -> $LATEST_VERSION" +#git push