44# ----------------------------
55# This script installs, uninstalls, backs up, restores App, and includes load testing using Locust.
66
7- USER_NAME=$( logname)
7+ USER_NAME=$USER
8+ echo $USER_NAME
9+ echo $HOME
10+ if [ " $( whoami) " = " root" ]; then
11+ USER_NAME=$( cat /etc/passwd | grep ' /home' | cut -d: -f1 | tail -n 1)
12+ else
13+ USER_NAME=$( whoami)
14+ fi
15+ echo $USER_NAME
816USER_HOME=/home/$USER_NAME
917
1018# Define directories and file paths
@@ -562,7 +570,7 @@ install_from_git() {
562570 # Construct the full Git URL with branch
563571 FULL_GIT_URL=" $GITHUB_URL -b $BRANCH "
564572
565- set_auto_update " $APP_NAME_LOWER -AUTO-UPDATE "
573+ set_auto_update " sg_auto_update "
566574
567575 log " Cloning the $APP_NAME repository from GitHub..."
568576 create_and_own_dir " $GIT_INSTALL_DIR "
@@ -874,8 +882,8 @@ update_dependencies() {
874882
875883 log " INFO" " Installing dependencies from $REQUIREMENTS_FILE ..."
876884
877- # Install dependencies silently
878- sudo -u " $SUDO_USER " bash -c " source $CONDA_SETUP_SCRIPT && conda activate $CONDA_ENV_NAME && pip install -r $EXTRACT_DIR /$APP_NAME -*/$REQUIREMENTS_FILE " > /dev/null 2>&1 || {
885+ # Install dependencies
886+ sudo -u " $SUDO_USER " bash -c " source $CONDA_SETUP_SCRIPT && conda activate $CONDA_ENV_NAME && pip install -r $EXTRACT_DIR /$APP_NAME -*/$REQUIREMENTS_FILE " || {
879887 log " ERROR" " Failed to install dependencies from $REQUIREMENTS_FILE ."
880888 exit 1
881889 }
@@ -888,7 +896,7 @@ install_conda_env() {
888896 log " Checking conda environment $CONDA_ENV_NAME ..."
889897 if ! " $CONDA_EXECUTABLE " env list | grep -q " $CONDA_ENV_NAME " ; then
890898 log " Creating Conda environment $CONDA_ENV_NAME ..."
891- " $CONDA_EXECUTABLE " create -n " $CONDA_ENV_NAME " python=3.8 -y || { log " ERROR" " Failed to create Conda environment $CONDA_ENV_NAME " ; exit 1; }
899+ " $CONDA_EXECUTABLE " create -n " $CONDA_ENV_NAME " python=3.11 -y || { log " ERROR" " Failed to create Conda environment $CONDA_ENV_NAME " ; exit 1; }
892900 # install the dependencies
893901 update_dependencies
894902 else
@@ -1050,3 +1058,4 @@ case $ACTION in
10501058 fetch_github_releases) fetch_github_releases ;;
10511059 * ) echo " No action specified. Use --help for usage information." ;;
10521060esac
1061+
0 commit comments