Compare commits

...

1 Commits

Author SHA1 Message Date
Ahmed Bouhuolia
f395cce710 fix(script): setup script 2026-01-29 20:49:54 +02:00

View File

@@ -2,7 +2,6 @@
# Initialize the essential variables. # Initialize the essential variables.
BRANCH=main BRANCH=main
CURRENT=$PWD CURRENT=$PWD
BIGCAPITAL_INSTALL_DIR=$PWD/bigcapital-$(echo $BRANCH | sed -r 's@(\/|" "|\.)@-@g')
BIGCAPITAL_CLONE_TEMP_DIR=$(mktemp -d) BIGCAPITAL_CLONE_TEMP_DIR=$(mktemp -d)
CPU_ARCH=$(uname -m) CPU_ARCH=$(uname -m)
@@ -20,8 +19,6 @@ else
COMPOSE_CMD="docker compose" COMPOSE_CMD="docker compose"
fi fi
REPO=https://github.com/bigcapitalhq/bigcapital
# Prints the Bigcapital logo once running the script. # Prints the Bigcapital logo once running the script.
function print_logo() { function print_logo() {
clear clear
@@ -142,8 +139,8 @@ function askForAction() {
} }
function install() { function install() {
echo "Installing Bigcaoital.........." echo "Installing Bigcapital.........."
echo "installing is going to take few mintues..." echo "installing is going to take few minutes..."
download download
setup_env setup_env
} }
@@ -203,10 +200,11 @@ function startServices() {
done done
printf "\r\033[K" printf "\r\033[K"
echo " API server started successfully ✅" echo " API server started successfully ✅"
source "${DOCKER_ENV_PATH}" ACCESS_URL=$(grep -E '^BASE_URL=' "$DOCKER_ENV_PATH" 2>/dev/null | cut -d= -f2-)
[ -z "$ACCESS_URL" ] && ACCESS_URL="http://localhost"
echo " Bigcapital server started successfully ✅" echo " Bigcapital server started successfully ✅"
echo "" echo ""
echo " You can access the application at $WEB_URL" echo " You can access the application at $ACCESS_URL"
echo "" echo ""
} }
@@ -223,20 +221,19 @@ function restartServices() {
} }
function viewLogs(){ function viewLogs(){
ARG_SERVICE_NAME=$2
echo echo
echo "Select a Service you want to view the logs for:" echo "Select a Service you want to view the logs for:"
echo " 1) Webapp" echo " 1) Webapp"
echo " 2) API" echo " 2) API"
echo " 3) Migration" echo " 3) Migration"
echo " 4) Nginx Proxy" echo " 4) Envoy Proxy"
echo " 5) MariaDB" echo " 5) MariaDB"
echo " 0) Back to Main Menu" echo " 0) Back to Main Menu"
echo echo
read -p "Service: " DOCKER_SERVICE_NAME read -p "Service: " DOCKER_SERVICE_NAME
until (( DOCKER_SERVICE_NAME >= 0 && DOCKER_SERVICE_NAME <= 5 )); do until (( DOCKER_SERVICE_NAME >= 0 && DOCKER_SERVICE_NAME <= 5 )); do
echo "Invalid selection. Please enter a number between 1 and 11." echo "Invalid selection. Please enter a number between 0 and 5."
read -p "Service: " DOCKER_SERVICE_NAME read -p "Service: " DOCKER_SERVICE_NAME
done done
@@ -248,7 +245,7 @@ function viewLogs(){
1) viewSpecificLogs "webapp";; 1) viewSpecificLogs "webapp";;
2) viewSpecificLogs "server";; 2) viewSpecificLogs "server";;
3) viewSpecificLogs "database_migration";; 3) viewSpecificLogs "database_migration";;
4) viewSpecificLogs "nginx";; 4) viewSpecificLogs "proxy";;
5) viewSpecificLogs "mysql";; 5) viewSpecificLogs "mysql";;
0) askForAction;; 0) askForAction;;
*) echo "INVALID SERVICE NAME SUPPLIED";; *) echo "INVALID SERVICE NAME SUPPLIED";;