Skip to content
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

tools: add a newly tool for updating a upgrade page #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tools/update-pgroonga-upgrade-page.sh
Original file line number Diff line number Diff line change
@@ -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 [email protected]: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 <<CONTENTS | sed -ie "/^Here is a list of compatibility/r /dev/stdin" upgrade/index.md

* $PREVIOUS_VERSION -> $LATEST_VERSION: o
CONTENTS
else
set +u
INCOMPATIBLE_REASON=$2
set -u
cat <<CONTENTS | sed -ie "/^Here is a list of compatibility/r /dev/stdin" upgrade/index.md

* $PREVIOUS_VERSION -> $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