Browse Source

Modified script to accept user inputs like repository name, instance name,type,user name etc..

pull/15/head
pavanendar 1 year ago
parent
commit
d896867c9f
1 changed files with 39 additions and 16 deletions
  1. 39
    16
      i.lin.sh

+ 39
- 16
i.lin.sh View File

#!/bin/bash


# PB : TODO -- Prompt if not passed in. # PB : TODO -- Prompt if not passed in.
REPOSERVER=http://git.bbh
DEFAULTREPOOWNER=chess
echo "Enter repo server URL:"
read reposervername
REPOSERVER=$reposervername
echo "Enter default repo owner:"
read defaultrepoownername
DEFAULTREPOOWNER=$defaultrepoownername
REPOOWNER=$DEFAULTREPOOWNER REPOOWNER=$DEFAULTREPOOWNER
INSTANCENAME=elixir
INSTANCETYPE=dev
GITUSER=pb
GITEMAIL=pradeep@bbh.org.in

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 #OPTIONS
SKIPPREREQS=true
SKIPDEVPREREQS=true
SKIPPREREQS=false
SKIPDEVPREREQS=false


if [ "$SKIPPREREQS" = "true" ]; then if [ "$SKIPPREREQS" = "true" ]; then
echo "skipping prereqs for firstrun" echo "skipping prereqs for firstrun"
# Install prerequisites for dev environment # Install prerequisites for dev environment
sudo apt install git sudo apt install git
git config --global user.name "$GITUSER" git config --global user.name "$GITUSER"
git config --global user.email "$GITEMAIL"
git config --global credential.helper store git config --global credential.helper store
git clone $REPOSERVER/$REPOOWNER/bbhverse
#git config --global credential.helper 'store --file ~/.git-credentials' #git config --global credential.helper 'store --file ~/.git-credentials'
#echo "Enter git username: " #echo "Enter git username: "
#read gitUser #read gitUser
#git config --global user.name '${gitUser}'
# git config --global user.name '${gitUser}'
#echo "username=$gitUser" >> ~/.git-credentials #echo "username=$gitUser" >> ~/.git-credentials
#echo "Enter git password: " #echo "Enter git password: "
#read gitPassword #read gitPassword


sudo mkdir -p /var/chess sudo mkdir -p /var/chess
sudo chown $USER:$USER /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 ROOT=/var/chess/$INSTANCENAME/$INSTANCETYPE
echo $ROOT
sudo mkdir -p $ROOT
mkdir -p $ROOT
sudo chown $USER:$USER $ROOT
cd $ROOT cd $ROOT


git clone $REPOSERVER/$REPOOWNER/elxr.git git clone $REPOSERVER/$REPOOWNER/elxr.git


# Install mysql # Install mysql
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names # 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 apt install mysql-server -y
# 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
EOF
sudo debconf-show mysql-server
sudo apt install mysql-server -y
systemctl is-active mysql systemctl is-active mysql
#sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mysql#minA1';" #sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mysql#minA1';"
#sudo mysql_secure_installation #sudo mysql_secure_installation


echo module.exports = { instanceName : "'$INSTANCENAME'", reposerver: "'$REPOSERVER'", gitUser: "'$GITUSER'", gitEmail:"'$GITEMAIL'" } > installchoices.js echo module.exports = { instanceName : "'$INSTANCENAME'", reposerver: "'$REPOSERVER'", gitUser: "'$GITUSER'", gitEmail:"'$GITEMAIL'" } > installchoices.js
elxr use elixir elxr use elixir
elxr i

elxr i

Loading…
Cancel
Save