From aaceb4b6586b934586c79e18eb4e50d019cb22dd Mon Sep 17 00:00:00 2001 From: Meng Sen Date: Mon, 2 Dec 2024 17:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=BA=94=E7=94=A8=EF=BC=9Ato?= =?UTF-8?q?piam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Meng Sen --- apps/topiam-ce/2.0.0/scripts/init.sh | 15 ++++++++++++++- apps/topiam-ce/2.0.0/scripts/uninstall.sh | 10 ++++++++++ apps/topiam-ce/2.0.0/scripts/upgrade.sh | 17 +++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 apps/topiam-ce/2.0.0/scripts/uninstall.sh create mode 100644 apps/topiam-ce/2.0.0/scripts/upgrade.sh diff --git a/apps/topiam-ce/2.0.0/scripts/init.sh b/apps/topiam-ce/2.0.0/scripts/init.sh index 2d5a8efca..07fb8c3fe 100644 --- a/apps/topiam-ce/2.0.0/scripts/init.sh +++ b/apps/topiam-ce/2.0.0/scripts/init.sh @@ -1,4 +1,17 @@ #!/bin/bash -chown -R 1001:1001 data/logs +if [ -f .env ]; then + source .env + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/topiam-ce/2.0.0/scripts/uninstall.sh b/apps/topiam-ce/2.0.0/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/topiam-ce/2.0.0/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/topiam-ce/2.0.0/scripts/upgrade.sh b/apps/topiam-ce/2.0.0/scripts/upgrade.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/topiam-ce/2.0.0/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi