From a1a09373c7fae305f47f8ae35ca038fb5fd5b82a Mon Sep 17 00:00:00 2001 From: zyyang Date: Tue, 7 Jun 2022 14:06:57 +0800 Subject: [PATCH] other: release script modify --- packaging/clean_env.bat | 37 ++++++++++++++++++++++++++++++++++++ packaging/clean_env.sh | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 packaging/clean_env.bat create mode 100644 packaging/clean_env.sh diff --git a/packaging/clean_env.bat b/packaging/clean_env.bat new file mode 100644 index 0000000000..069102cf7b --- /dev/null +++ b/packaging/clean_env.bat @@ -0,0 +1,37 @@ +@echo off + +set CUR_DIR=%~dp0 +set SHELL_DIR=%cd% +set ENTERPRISE_DIR="%SHELL_DIR%\..\.." +set COMMUNITY_DIR="%SHELL_DIR%\.." +set TOOLS_DIR="%SHELL_DIR%\..\src\kit\taos-tools" + +cd %ENTERPRISE_DIR% +git checkout -- . +if exist "enterprise\src\plugins\taosainternal\taosadapter" ( + del /f "enterprise\src\plugins\taosainternal\taosadapter" +) +if exist "enterprise\src\plugins\taosainternal\upx.tar.xz" ( + del /f "enterprise\src\plugins\taosainternal\upx.tar.xz" +) + +cd %COMMUNITY_DIR% +git checkout -- . + +cd %TOOLS_DIR% +git checkout -- . +if exist "packaging\tools\install-khtools.sh" ( + del /f "packaging\tools\install-khtools.sh" +) +if exist "packaging\tools\uninstall-khtools.sh" ( + del /f "packaging/tools/uninstall-khtools.sh" +) + +if exist "packaging\tools\install-prodbtools.sh" ( + del /f "packaging\tools\install-prodbtools.sh" +) +if exist "packaging\tools\uninstall-prodbtools.sh" ( + del /f "packaging\tools\uninstall-prodbtools.sh" +) + +cd %CUR_DIR% \ No newline at end of file diff --git a/packaging/clean_env.sh b/packaging/clean_env.sh new file mode 100644 index 0000000000..51a0fe4eb2 --- /dev/null +++ b/packaging/clean_env.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +CUR_DIR=$(pwd) +SHELL_DIR=$(dirname $(readlink -f "$0")) +ENTERPRISE_DIR=$SHELL_DIR/../.. +COMMUNITY_DIR=$SHELL_DIR/.. +TOOLS_DIR=$COMMUNITY_DIR/src/kit/taos-tools + +cd $ENTERPRISE_DIR +git checkout -- . +if [[ -e enterprise/src/plugins/taosainternal/taosadapter ]]; then + rm -f enterprise/src/plugins/taosainternal/taosadapter +fi +if [[ -e enterprise/src/plugins/taosainternal/upx.tar.xz ]]; then + rm -f enterprise/src/plugins/taosainternal/upx.tar.xz +fi + +cd $COMMUNITY_DIR +git checkout -- . +if [[ -e src/plugins/taosadapter/taosadapter ]]; then + rm -f src/plugins/taosadapter/taosadapter +fi +if [[ -e src/plugins/taosadapter/upx.tar.xz ]]; then + rm -f src/plugins/taosadapter/upx.tar.xz +fi + +cd $TOOLS_DIR +git checkout -- . + +rm -f $(find packaging/tools/ -name install-*tools.sh | grep -v taos) +rm -f $(find packaging/tools/ -name uninstall-*tools.sh | grep -v taos) + +rm -rf $COMMUNITY_DIR/debug/* +rm -rf $COMMUNITY_DIR/release/* +if [[ -e $COMMUNITY_DIR/rpms ]]; then + rm -rf $COMMUNITY_DIR/rpms +fi +if [[ -e $COMMUNITY_DIR/debs ]]; then + rm -rf $COMMUNITY_DIR/debs +fi + +cd $CUR_DIR -- GitLab