Skip to content

updating dev changes to production #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed improvments
Empty file.
21 changes: 7 additions & 14 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
# ----------------------------
# This script installs, uninstalls, backs up, restores App, and includes load testing using Locust.

if [ "$(whoami)" = "root" ]; then
USER_NAME=$(cat /etc/passwd | grep '/home' | cut -d: -f1 | head -n 1)
else
USER_NAME=$(whoami)
fi

echo "Welcome on board $USER_NAME"
USER_NAME=$(logname)
USER_HOME=/home/$USER_NAME

# Define directories and file paths
Expand All @@ -29,8 +23,7 @@ HOST_URL="http://localhost:5050"
INSTALLER_SCRIPT="setup.sh"
FLASK_LOG_FILE="$LOG_DIR/flask.log"

# Backup settings
NUM_BACKUPS=5


# Cron job pattern
CRON_PATTERN=".$APP_NAME_LOWER/${APP_NAME}-.*/src/scripts/dashboard.sh"
Expand All @@ -41,9 +34,11 @@ GITHUB_REPO="$APP_NAME"
GITHUB_URL="https://github.com/$GITHUB_USER/$GITHUB_REPO"
ISSUE_TRACKER_URL="$GITHUB_URL/issues"
NUM_OF_RELEASES=5

NUM_OF_RETRIES=5

# Backup settings
NUM_BACKUPS=5

# Environment variables
CONDA_ENV_NAME="$APP_NAME_LOWER"
ENV_FILE="$USER_HOME/.bashrc" # Default environment file
Expand Down Expand Up @@ -138,11 +133,12 @@ generate_ascii_art "$APP_NAME" "yellow"
generate_ascii_art "Installer" "yellow"
generate_ascii_art "By" "yellow"
generate_ascii_art "CodePerfectPlus" "yellow"
echo "Welcome on board: Mr. $(echo "$USER_NAME" | sed 's/.*/\u&/')"

# function to check for required dependencies
check_dependencies() {
# List of required dependencies
local dependencies=(git curl wget unzip iptables)
local dependencies=(git curl wget unzip iptables figlet)

# Check if `apt-get` is available
if ! command -v apt-get &> /dev/null; then
Expand Down Expand Up @@ -283,8 +279,6 @@ check_conda() {
echo "ERROR: Conda not found. Please install Conda or check your Conda paths."
exit 1
fi

echo "Conda found at: $CONDA_EXECUTABLE"
}

# Function to add a cron job with error handling
Expand Down Expand Up @@ -472,7 +466,6 @@ fetch_latest_version() {

# Fetch the latest version from GitHub
API_URL="https://api.github.com/repos/$GITHUB_USER/$GITHUB_REPO/releases/latest"
echo "API URL: $API_URL"
RESPONSE=$(curl -s -w "%{http_code}" -o /tmp/latest_version.json "$API_URL")
HTTP_CODE="${RESPONSE: -3}" # Extract HTTP status code

Expand Down
3 changes: 2 additions & 1 deletion src/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ chmod +x install_miniconda.sh && sudo ./install_miniconda.sh

### Installation Steps

1. Update your system:
1. Update your system and install the required dependencies:

```bash
sudo apt-get update
sudo apt-get install git curl wget unzip iptables figlet
```

2. Download and set up the SystemGuard installer:
Expand Down