version=2.1.0
server_repo=https://gitee.com/opengauss/openGauss-server.git
git clone $server_repo openGauss-server-$version
cd openGauss-server-$version
gitcommit=$(git log 2>/dev/null | grep commit | head -1 | awk '{print $2}' | cut -b 1-8)
echo $gitcommit > ../COMMIT
rm -rf src/test/regress/jar
rm -rf src/test/regress/output
rm -rf src/test/regress/expected
rm -rf src/test/regress/sql
rm -rf src/test/regress/data
rm -rf src/test/regress/jdbc_test
rm -rf src/test/regress/input
rm -rf .git
rm -rf ./docker
cd ..
tar -zcf "openGauss-server-${version}.tar.gz" openGauss-server-$version
