|
|
|
|
|
|
|
|
#!/bin/bash |
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
# PB : TODO -- Prompt if not passed in. |
|
|
|
|
|
echo "Enter repo server URL:" |
|
|
|
|
|
read reposervername |
|
|
|
|
|
REPOSERVER=$reposervername |
|
|
|
|
|
echo "Enter default repo owner:" |
|
|
|
|
|
read defaultrepoownername |
|
|
|
|
|
DEFAULTREPOOWNER=$defaultrepoownername |
|
|
|
|
|
REPOOWNER=$DEFAULTREPOOWNER |
|
|
|
|
|
echo "Enter instance name" |
|
|
|
|
|
read instancename |
|
|
|
|
|
INSTANCENAME=$instancename |
|
|
|
|
|
echo "Enter instance type:" |
|
|
|
|
|
read instancetypename |
|
|
|
|
|
INSTANCETYPE=$instancetypename |
|
|
|
|
|
echo "Enter Git user name:" |
|
|
|
|
|
read GITUSERID |
|
|
|
|
|
GITUSER=$GITUSERID |
|
|
|
|
|
echo "Enter Git user email:" |
|
|
|
|
|
read GITEMAILID |
|
|
|
|
|
GITEMAIL=$GITEMAILID |
|
|
|
|
|
|
|
|
|
|
|
# If $GITUSER = {{"git user id"}} then set $GITUSER = $USER # TODO : pavanendar -- read from user input default as login user. |
|
|
|
|
|
|
|
|
|
|
|
#OPTIONS |
|
|
|
|
|
SKIPPREREQS=false |
|
|
|
|
|
SKIPDEVPREREQS=false |
|
|
|
|
|
|
|
|
|
|
|
if [ "$SKIPPREREQS" = "true" ]; then |
|
|
|
|
|
echo "skipping prereqs for firstrun" |
|
|
|
|
|
|
|
|
# Default values |
|
|
|
|
|
DEFAULT_REPOSERVER="http://git.bbh" |
|
|
|
|
|
DEFAULT_DEFAULTREPOOWNER="chess" |
|
|
|
|
|
DEFAULT_INSTANCENAME="cihsr" |
|
|
|
|
|
DEFAULT_INSTANCETYPE="development" |
|
|
|
|
|
DEFAULT_GITUSER="pb" |
|
|
|
|
|
DEFAULT_GITEMAIL="chess@bbh.org.in" |
|
|
|
|
|
|
|
|
|
|
|
# Prompt for user input with default values |
|
|
|
|
|
echo "Enter repo server URL (default: $DEFAULT_REPOSERVER):" |
|
|
|
|
|
read reposervername |
|
|
|
|
|
REPOSERVER=${reposervername:-$DEFAULT_REPOSERVER} |
|
|
|
|
|
|
|
|
|
|
|
echo "Enter default repo owner (default: $DEFAULT_DEFAULTREPOOWNER):" |
|
|
|
|
|
read defaultrepoownername |
|
|
|
|
|
DEFAULTREPOOWNER=${defaultrepoownername:-$DEFAULT_DEFAULTREPOOWNER} |
|
|
|
|
|
REPOOWNER=$DEFAULTREPOOWNER |
|
|
|
|
|
|
|
|
|
|
|
echo "Enter instance name (default: $DEFAULT_INSTANCENAME):" |
|
|
|
|
|
read instancename |
|
|
|
|
|
INSTANCENAME=${instancename:-$DEFAULT_INSTANCENAME} |
|
|
|
|
|
|
|
|
|
|
|
echo "Enter instance type (default: $DEFAULT_INSTANCETYPE):" |
|
|
|
|
|
read instancetypename |
|
|
|
|
|
INSTANCETYPE=${instancetypename:-$DEFAULT_INSTANCETYPE} |
|
|
|
|
|
|
|
|
|
|
|
echo "Enter Git user name (default: $DEFAULT_GITUSER):" |
|
|
|
|
|
read GITUSERID |
|
|
|
|
|
GITUSER=${GITUSERID:-$DEFAULT_GITUSER} |
|
|
|
|
|
|
|
|
|
|
|
echo "Enter Git user email (default: $DEFAULT_GITEMAIL):" |
|
|
|
|
|
read GITEMAILID |
|
|
|
|
|
GITEMAIL=${GITEMAILID:-$DEFAULT_GITEMAIL} |
|
|
|
|
|
|
|
|
|
|
|
# Prompt for skipping prerequisites |
|
|
|
|
|
echo "Do you want to skip prerequisite installations? (yes/no, default: no)" |
|
|
|
|
|
read skipprereqs |
|
|
|
|
|
SKIPPREREQS=${skipprereqs:-"no"} |
|
|
|
|
|
|
|
|
|
|
|
# Prompt for skipping dev prerequisites |
|
|
|
|
|
echo "Do you want to skip development prerequisite installations? (yes/no, default: no)" |
|
|
|
|
|
read skipdevprereqs |
|
|
|
|
|
SKIPDEVPREREQS=${skipdevprereqs:-"no"} |
|
|
|
|
|
|
|
|
|
|
|
# Prompt for ROOT folder, with two options: current directory or /var/chess/$INSTANCENAME/$INSTANCETYPE |
|
|
|
|
|
echo "Enter the ROOT folder location (default: current directory):" |
|
|
|
|
|
echo "1) Current directory" |
|
|
|
|
|
echo "2) /var/chess/$INSTANCENAME/$INSTANCETYPE" |
|
|
|
|
|
read rootfolder |
|
|
|
|
|
if [ "$rootfolder" == "2" ]; then |
|
|
|
|
|
ROOT=/var/chess/$INSTANCENAME/$INSTANCETYPE |
|
|
|
|
|
else |
|
|
|
|
|
ROOT=$(pwd) # Default to current directory if user chooses 1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# If ROOT is not the current directory, create the necessary directories and change to ROOT |
|
|
|
|
|
if [ "$ROOT" != "$(pwd)" ]; then |
|
|
|
|
|
sudo mkdir -p /var/chess |
|
|
|
|
|
sudo chown $USER:$USER /var/chess |
|
|
|
|
|
mkdir -p /var/chess/$INSTANCENAME |
|
|
|
|
|
sudo chown $USER:$USER /var/chess/$INSTANCENAME |
|
|
|
|
|
mkdir -p $ROOT |
|
|
|
|
|
sudo chown $USER:$USER $ROOT |
|
|
|
|
|
|
|
|
|
|
|
# Change to ROOT directory |
|
|
|
|
|
cd $ROOT || { echo "Failed to change to ROOT directory $ROOT"; exit 1; } |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Platform-specific installation |
|
|
|
|
|
if [ -f /etc/os-release ]; then |
|
|
|
|
|
. /etc/os-release |
|
|
|
|
|
OS_NAME=$NAME |
|
|
|
|
|
OS_VERSION=$VERSION_ID |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Function to check if a package is installed |
|
|
|
|
|
is_package_installed() { |
|
|
|
|
|
local package=$1 |
|
|
|
|
|
if command -v $package &>/dev/null; then |
|
|
|
|
|
return 0 # Package is installed |
|
|
else |
|
|
else |
|
|
|
|
|
|
|
|
sudo groupadd chessprod |
|
|
|
|
|
|
|
|
|
|
|
echo "$USER" |
|
|
|
|
|
sudo usermod -a -G chessprod $USER |
|
|
|
|
|
|
|
|
|
|
|
sudo apt update |
|
|
|
|
|
|
|
|
|
|
|
# Install prerequisites for dev environment |
|
|
|
|
|
sudo apt install git |
|
|
|
|
|
git config --global user.name "$GITUSER" |
|
|
|
|
|
git config --global user.email "$GITEMAIL" |
|
|
|
|
|
git config --global credential.helper store |
|
|
|
|
|
git clone $REPOSERVER/$REPOOWNER/bbhverse |
|
|
|
|
|
#git config --global credential.helper 'store --file ~/.git-credentials' |
|
|
|
|
|
#echo "Enter git username: " |
|
|
|
|
|
#read gitUser |
|
|
|
|
|
# git config --global user.name '${gitUser}' |
|
|
|
|
|
#echo "username=$gitUser" >> ~/.git-credentials |
|
|
|
|
|
#echo "Enter git password: " |
|
|
|
|
|
#read gitPassword |
|
|
|
|
|
#git config --global user.password '${gitPassword}' |
|
|
|
|
|
#echo "password=$gitPassword" >> ~/.git-credentials |
|
|
|
|
|
#chmod 0600 ~/.git-credentials |
|
|
|
|
|
|
|
|
|
|
|
sudo apt install python2 |
|
|
|
|
|
sudo apt install build-essential |
|
|
|
|
|
sudo apt install -y make |
|
|
|
|
|
|
|
|
|
|
|
#INSTALLING NODE JS |
|
|
|
|
|
cd ~ |
|
|
|
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh |
|
|
|
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash |
|
|
|
|
|
sleep 2 |
|
|
|
|
|
touch ~/.bashrc |
|
|
|
|
|
source ~/.bashrc |
|
|
|
|
|
export NVM_DIR="$HOME/.nvm" |
|
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm |
|
|
|
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
|
|
|
|
|
sleep 2 |
|
|
|
|
|
nvm list-remote |
|
|
|
|
|
sleep 2 |
|
|
|
|
|
nvm install v16.19.1 |
|
|
|
|
|
sleep 2 |
|
|
|
|
|
node --version |
|
|
|
|
|
npm --version |
|
|
|
|
|
|
|
|
|
|
|
# OLD version... |
|
|
|
|
|
#sudo apt install nodejs |
|
|
|
|
|
#sudo apt install npm |
|
|
|
|
|
# For production we create a npm global per user. |
|
|
|
|
|
# npm prefix is not compatible with nvm!!! |
|
|
|
|
|
# mkdir -p ~/.user_global_node_modules/ |
|
|
|
|
|
# npm config set prefix '~/.user_global_node_modules' |
|
|
|
|
|
# sudo mkdir /usr/local/lib/node_modules/ |
|
|
|
|
|
# sudo chown -R root:chessprod /usr/local/lib/node_modules/ |
|
|
|
|
|
# sudo chmod g+w /usr/local/lib/node_modules/ |
|
|
|
|
|
# grep -qxF 'export PATH=~/.user_global_node_modules/bin:$PATH' ~/.profile || echo 'export PATH=~/.user_global_node_modules/bin:$PATH' >> ~/.profile |
|
|
|
|
|
|
|
|
|
|
|
if [ "$SKIPPREREQS" = "true" ]; then |
|
|
|
|
|
echo "skipping dev prereqs for firstrun" |
|
|
|
|
|
|
|
|
return 1 # Package is not installed |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Function to install packages based on the package manager |
|
|
|
|
|
install_package() { |
|
|
|
|
|
local package=$1 |
|
|
|
|
|
if [ "$OS_NAME" == "Ubuntu" ] || [ "$OS_NAME" == "Debian" ]; then |
|
|
|
|
|
sudo apt update |
|
|
|
|
|
sudo apt install -y $package || { echo "Failed to install $package"; exit 1; } |
|
|
|
|
|
elif [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS" ]] || [[ "$OS_NAME" == "Red Hat" ]]; then |
|
|
|
|
|
# Prefer dnf for CentOS 8 and above |
|
|
|
|
|
if command -v dnf &>/dev/null; then |
|
|
|
|
|
sudo dnf install -y $package || { echo "Failed to install $package"; exit 1; } |
|
|
else |
|
|
else |
|
|
#install code |
|
|
|
|
|
sudo apt-get install wget gpg |
|
|
|
|
|
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg |
|
|
|
|
|
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg |
|
|
|
|
|
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' |
|
|
|
|
|
rm -f packages.microsoft.gpg |
|
|
|
|
|
sudo apt install apt-transport-https |
|
|
|
|
|
sudo apt update |
|
|
|
|
|
sudo apt install code |
|
|
|
|
|
install code |
|
|
|
|
|
sudo apt-get install wget gpg |
|
|
|
|
|
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg |
|
|
|
|
|
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg |
|
|
|
|
|
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' |
|
|
|
|
|
rm -f packages.microsoft.gpg |
|
|
|
|
|
sudo apt install apt-transport-https |
|
|
|
|
|
sudo apt update |
|
|
|
|
|
sudo apt install code |
|
|
|
|
|
|
|
|
sudo yum install -y $package || { echo "Failed to install $package"; exit 1; } |
|
|
fi |
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
echo "Unsupported OS $OS_NAME" |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Install prerequisites |
|
|
|
|
|
if [ "$SKIPPREREQS" = "yes" ]; then |
|
|
|
|
|
echo "Skipping prerequisites for first run" |
|
|
|
|
|
else |
|
|
|
|
|
# Create group and add user (skip failure) |
|
|
|
|
|
sudo groupadd chessprod || echo "Group 'chessprod' already exists or failed to create, proceeding..." |
|
|
|
|
|
sudo usermod -a -G chessprod $USER || echo "Failed to add user $USER to chessprod group or already a member, proceeding..." |
|
|
|
|
|
|
|
|
|
|
|
# Install Git if not already installed |
|
|
|
|
|
if ! is_package_installed "git"; then |
|
|
|
|
|
install_package "git" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
git config --global user.name "$GITUSER" |
|
|
|
|
|
git config --global user.email "$GITEMAIL" |
|
|
|
|
|
git config --global credential.helper store |
|
|
|
|
|
|
|
|
sudo mkdir -p /var/chess |
|
|
|
|
|
sudo chown $USER:$USER /var/chess |
|
|
|
|
|
mkdir -p /var/chess/$INSTANCENAME |
|
|
|
|
|
sudo chown $USER:$USER /var/chess/$INSTANCENAME |
|
|
|
|
|
ROOT=/var/chess/$INSTANCENAME/$INSTANCETYPE |
|
|
|
|
|
mkdir -p $ROOT |
|
|
|
|
|
sudo chown $USER:$USER $ROOT |
|
|
|
|
|
|
|
|
|
|
|
cd $ROOT |
|
|
|
|
|
|
|
|
|
|
|
git clone $REPOSERVER/$REPOOWNER/elxr.git |
|
|
|
|
|
|
|
|
|
|
|
cd elxr |
|
|
|
|
|
npm i |
|
|
|
|
|
npm link |
|
|
|
|
|
cd .. |
|
|
|
|
|
|
|
|
|
|
|
# Install mysql |
|
|
|
|
|
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names |
|
|
|
|
|
# sudo debconf-set-selections < "mysql-server mysql-server/lowercase-table-names select Enabled" |
|
|
|
|
|
|
|
|
|
|
|
sudo debconf-set-selections <<EOF |
|
|
|
|
|
mysql-server mysql-server/lowercase-table-names select Enabled |
|
|
|
|
|
|
|
|
# Install Python 2 if not installed |
|
|
|
|
|
if ! is_package_installed "python2"; then |
|
|
|
|
|
install_package "python2" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Install build tools based on OS type |
|
|
|
|
|
if [ "$OS_NAME" == "Ubuntu" ] || [ "$OS_NAME" == "Debian" ]; then |
|
|
|
|
|
install_package "build-essential" |
|
|
|
|
|
elif [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS" ]] || [[ "$OS_NAME" == "Red Hat" ]]; then |
|
|
|
|
|
install_package "gcc" |
|
|
|
|
|
install_package "make" |
|
|
|
|
|
install_package "glibc-devel" |
|
|
|
|
|
install_package "gcc-c++" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Installing Node.js and NVM |
|
|
|
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash |
|
|
|
|
|
sleep 2 |
|
|
|
|
|
|
|
|
|
|
|
# Add NVM configuration to .bash_profile |
|
|
|
|
|
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile |
|
|
|
|
|
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bash_profile |
|
|
|
|
|
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ~/.bash_profile |
|
|
|
|
|
|
|
|
|
|
|
# Source .bash_profile to apply NVM setup |
|
|
|
|
|
source ~/.bash_profile |
|
|
|
|
|
|
|
|
|
|
|
# Install Node.js |
|
|
|
|
|
nvm install v16.19.1 |
|
|
|
|
|
node --version |
|
|
|
|
|
npm --version |
|
|
|
|
|
|
|
|
|
|
|
# Install code editor (VSCode) |
|
|
|
|
|
if [[ "$OS_NAME" == "Ubuntu" ]] || [[ "$OS_NAME" == "Debian" ]]; then |
|
|
|
|
|
# VSCode installation for Debian-based systems (Ubuntu/Debian) |
|
|
|
|
|
install_package "wget" |
|
|
|
|
|
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg |
|
|
|
|
|
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg |
|
|
|
|
|
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' |
|
|
|
|
|
rm -f packages.microsoft.gpg |
|
|
|
|
|
sudo apt install apt-transport-https |
|
|
|
|
|
sudo apt update |
|
|
|
|
|
sudo apt install code -y |
|
|
|
|
|
elif [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS" ]] || [[ "$OS_NAME" == "Red Hat" ]]; then |
|
|
|
|
|
# VSCode installation for CentOS-based systems (CentOS 8 / RHEL) |
|
|
|
|
|
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc |
|
|
|
|
|
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' |
|
|
|
|
|
sudo dnf check-update |
|
|
|
|
|
sudo dnf install code -y |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Install OpenJDK 11 (Java) for both Debian/Ubuntu and CentOS/RHEL systems |
|
|
|
|
|
if [ "$OS_NAME" == "Ubuntu" ] || [ "$OS_NAME" == "Debian" ]; then |
|
|
|
|
|
install_package "openjdk-11-jre-headless" |
|
|
|
|
|
elif [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS" ]] || [[ "$OS_NAME" == "Red Hat" ]]; then |
|
|
|
|
|
# Install Java 11 on CentOS/RHEL-based systems |
|
|
|
|
|
sudo dnf install java-11-openjdk -y || { echo "Failed to install Java 11"; exit 1; } |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# MySQL Installation for CentOS (without debconf-set-selections) |
|
|
|
|
|
if [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS" ]] || [[ "$OS_NAME" == "Red Hat" ]]; then |
|
|
|
|
|
sudo dnf install mysql-server -y |
|
|
|
|
|
sudo systemctl start mysqld |
|
|
|
|
|
sudo systemctl enable mysqld |
|
|
|
|
|
MYSQL_ROOT_PASSWORD=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}') |
|
|
|
|
|
echo "MySQL root temporary password: $MYSQL_ROOT_PASSWORD" |
|
|
|
|
|
# Secure MySQL installation |
|
|
|
|
|
sudo mysql_secure_installation |
|
|
|
|
|
else |
|
|
|
|
|
# If on Ubuntu/Debian, you can use debconf-set-selections |
|
|
|
|
|
sudo debconf-set-selections <<EOF |
|
|
|
|
|
mysql-server mysql-server/lowercase-table-names select Enabled |
|
|
EOF |
|
|
EOF |
|
|
sudo debconf-show mysql-server |
|
|
|
|
|
sudo apt install mysql-server -y |
|
|
|
|
|
systemctl is-active mysql |
|
|
|
|
|
#sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mysql#minA1';" |
|
|
|
|
|
#sudo mysql_secure_installation |
|
|
|
|
|
#sudo mysql -e "FLUSH PRIVILEGES;" -u root -pmysql#minA1 |
|
|
|
|
|
#systemctl status mysql.service |
|
|
|
|
|
|
|
|
sudo apt install mysql-server -y |
|
|
|
|
|
sudo systemctl start mysql |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# Init DB schema and Load Data |
|
|
|
|
|
#mysql -u root -pmysql#minA1 < cihsr-data/cihsr-dev-schema.sql |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
git clone $REPOSERVER/$REPOOWNER/bbhverse |
|
|
|
|
|
cd bbhverse |
|
|
|
|
|
npm i |
|
|
|
|
|
cd .. |
|
|
|
|
|
git clone $REPOSERVER/$REPOOWNER/serververse |
|
|
|
|
|
git clone $REPOSERVER/$REPOOWNER/global-this |
|
|
|
|
|
git clone $REPOSERVER/$REPOOWNER/elxr.git |
|
|
|
|
|
|
|
|
############## |
|
|
|
|
|
###UNINSTALL MYSQL |
|
|
|
|
|
#sudo apt-get remove --purge mysql* |
|
|
|
|
|
#sudo apt-get autoremove |
|
|
|
|
|
#sudo apt-get autoclean |
|
|
|
|
|
|
|
|
# Install npm dependencies and link |
|
|
|
|
|
cd elxr |
|
|
|
|
|
npm i |
|
|
|
|
|
npm link |
|
|
|
|
|
cd .. |
|
|
|
|
|
|
|
|
sudo apt install openjdk-22-jre-headless |
|
|
|
|
|
|
|
|
sudo ln -s $ROOT/elxr/bin/elxr $(npm bin -g)/elxr |
|
|
|
|
|
|
|
|
|
|
|
elxr use $INSTANCENAME |
|
|
|
|
|
elxr install |
|
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
echo "Module configuration generated for: $INSTANCENAME" |
|
|
|
|
|
echo "module.exports = { instanceName : '$INSTANCENAME', reposerver: '$REPOSERVER', gitUser: '$GITUSER', gitEmail: '$GITEMAIL' }" > installchoices.js |
|
|
|
|
|
|
|
|
|
|
|
echo "Setup completed successfully!" |
|
|
|
|
|
|
|
|
echo module.exports = { instanceName : "'$INSTANCENAME'", reposerver: "'$REPOSERVER'", gitUser: "'$GITUSER'", gitEmail:"'$GITEMAIL'" } > installchoices.js |
|
|
|
|
|
elxr use elixir |
|
|
|
|
|
elxr i |
|
|
|