diff --git a/clonecode.sh b/clonecode.sh index b8e47b7..cd7b12a 100644 --- a/clonecode.sh +++ b/clonecode.sh @@ -11,6 +11,7 @@ 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 src/test/regress/jdbc_client_lib rm -rf .git rm -rf ./docker cd .. diff --git a/openGauss-server-5.0.1.tar.gz b/openGauss-server-5.0.1.tar.gz index 03466c0..f2e0742 100644 Binary files a/openGauss-server-5.0.1.tar.gz and b/openGauss-server-5.0.1.tar.gz differ diff --git a/opengauss-server.spec b/opengauss-server.spec index e5452da..bc24a6f 100644 --- a/opengauss-server.spec +++ b/opengauss-server.spec @@ -179,6 +179,13 @@ if [ $1 = 1 ]; then fi fi +# upgrade installation +if [ $1 = 2 ]; then + pushd openGauss-server-%{version}/liteom + sh upgrade_GAUSSv5.sh upgrade_pre + popd +fi + %post # set opengauss mini config parameters set_mini_configparam(){ @@ -232,6 +239,17 @@ add_service(){ systemctl daemon-reload } +copy_bashrc(){ + copyResult=$(su - opengauss -c "echo 'export GAUSSHOME=/usr/local/opengauss/' >> ~/.bashrc && + echo 'export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH' >> ~/.bashrc && + echo 'export PATH=/usr/local/opengauss/bin:$PATH' >> ~/.bashrc && + echo 'export PGDATA=/var/lib/opengauss/data' >> ~/.bashrc && + echo 'export PORT=7654' >> ~/.bashrc && source ~/.bashrc") + if [ $? -ne 0 ]; then + exit $result + fi +} + # for install step if [ $1 = 1 ]; then chmod -R 755 /usr/local/opengauss @@ -239,6 +257,20 @@ if [ $1 = 1 ]; then set_mini_configparam start_opengauss add_service + copy_bashrc +fi + +# upgrade installation +if [ $1 = 2 ]; then + pushd openGauss-server-%{version}/liteom + sh upgrade_GAUSSv5.sh upgrade_bin + servicename=/usr/lib/systemd/system/opengauss.service + if [ -f $servicename ]; then + systemctl restart opengauss.service + fi + sh upgrade_GAUSSv5.sh upgrade_post + sh upgrade_GAUSSv5.sh upgrade_commit + popd fi %postun @@ -277,6 +309,9 @@ fi %changelog +* Fri May 24 2024 zhangzhihui - 5.0.1-12 +- upgrade function + * Mon May 6 2024 liuheng - 5.0.1-12 - Update version to 5.0.1 diff --git a/opengauss.service b/opengauss.service index 6da78c8..2a47b47 100755 --- a/opengauss.service +++ b/opengauss.service @@ -6,9 +6,9 @@ After=local-fs.target Type=forking User=opengauss WorkingDirectory=/var/lib/opengauss -ExecStart=/bin/bash -c 'source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data' -ExecStop=/bin/bash -c 'source ~/.bash_profile; gs_ctl stop -D /var/lib/opengauss/data' -ExecReload=/bin/bash -c 'source ~/.bash_profile; gs_ctl reload -D /var/lib/opengauss/data' +ExecStart=/bin/bash -c 'source ~/.bashrc; gs_ctl start -D /var/lib/opengauss/data' +ExecStop=/bin/bash -c 'source ~/.bashrc; gs_ctl stop -D /var/lib/opengauss/data' +ExecReload=/bin/bash -c 'source ~/.bashrc; gs_ctl reload -D /var/lib/opengauss/data' Delegate=yes RemainAfterExit=yes