Преглед на файлове

Merge branch 'master' of Trias_Org/elxr into master

production
chess преди 1 година
родител
ревизия
0a7ae6175d
променени са 4 файла, в които са добавени 61 реда и са изтрити 19 реда
  1. 17
    0
      trias/Database/mysql_restore.sh
  2. 3
    1
      trias/Server/trias_app_update.sh
  3. 26
    18
      trias/Server/trias_appserver_script.sh
  4. 15
    0
      trias/Server/trias_dbserver_script.sh

+ 17
- 0
trias/Database/mysql_restore.sh Целия файл

@@ -1,4 +1,19 @@
# Set the database credentials
sudo apt-get update
sudo apt-get -y install cifs-utils
cd /
mkdir mysql_backup
sleep 2

sudo chmod 777 mysql_backup
sleep 2

sudo mount //10.10.5.26/trias /mysql_backup/ -o username='baptist',password='2021Bbh',domain='bbh'
sleep 2

cd /mysql_backup/
ls

DB_USER="root"
DB_PASS="root@123"
DB_NAME="triq_demo"
@@ -8,5 +23,7 @@ echo "Enter the name of backup file: "
read fileName
BACKUP_FILE="/mysql_backup/$fileName"

mysql -u $DB_USER -p$DB_PASS -e "CREATE database triq_demo;"

# Restore backup file
mysql -u $DB_USER -p$DB_PASS $DB_NAME < $BACKUP_FILE

trias/trias_app_update.sh → trias/Server/trias_app_update.sh Целия файл

@@ -1,4 +1,6 @@
#SCRIPT TO PULL LATEST UPDATES AUTOMATICALLY
git config --global credential.helper store

cd ../project-genesis-backend
git pull

@@ -8,7 +10,7 @@ git pull
cd ../bbh_patient_portal
git pull

cd ../elixir-config-production
cd ../trias-config-production
git pull

cd ../processmanager

+ 26
- 18
trias/Server/trias_appserver_script.sh Целия файл

@@ -1,30 +1,38 @@
#STORE GIT CREDENTIALS IN CACHE
git config --global credential.helper store
git config --global credential.helper 'store --file ~/.git-credentials'
echo "Enter git username: "
read gitUser
echo "username=$gitUser" >> ~/.git-credentials
echo "Enter git password: "
read gitPassword
echo "password=$gitPassword" >> ~/.git-credentials
chmod 0600 ~/.git-credentials

#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
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
npm install -g @angular/cli
npm install -g pm2
pm2 install typescript
# echo "Enter the version of node you want to install: (Example. 'v16.19.1')"
# read nodeversion
# nvm install $nodeversion

#STORE GIT CREDENTIALS IN CACHE
git config --global credential.helper store
# 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

#PRODUCTION A SETUP
cd ~
cd Desktop
@@ -50,8 +58,8 @@ git checkout production
npm i

cd ..
git clone http://git.bbh.org.in/chess/elixir-config-production
cd elixir-config-production
git clone http://git.bbh.org.in/Trias_Org/trias-config-production
cd trias-config-production
git checkout production
npm i

@@ -63,7 +71,7 @@ npm i

#TO CREATE SYMLINK
cd ..
ln -s elixir-config-production/ config
ln -s trias-config-production/ config

#PRODUCTION B SETUP
cd ~
@@ -89,8 +97,8 @@ git checkout production
npm i

cd ..
git clone http://git.bbh.org.in/chess/elixir-config-production
cd elixir-config-production
git clone http://git.bbh.org.in/Trias_Org/trias-config-production
cd trias-config-production
git checkout production
npm i

@@ -102,4 +110,4 @@ npm i

#TO CREATE SYMLINK
cd ..
ln -s elixir-config-production/ config
ln -s trias-config-production/ config

+ 15
- 0
trias/Server/trias_dbserver_script.sh Целия файл

@@ -3,6 +3,11 @@ sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service

sleep 2

cd /
sudo mkdir mysql_backup

#STEPS FOR MYSQL_SECURE_INSTALLATION
#STEP-1 sudo mysql
#STEP-2 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SET_PASSWORD';
@@ -20,4 +25,14 @@ sudo systemctl start mysql.service
#STEP-14 GRANT ALL PRIVILEGES ON *.* TO '_username_'@'_desiredIP_' WITH GRANT OPTION;
#STEP-15 FLUSH PRIVILEGES;

echo "Please enter password for mysql: "
read password
sudo mysql -u root -p${password} -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${password}';"
sudo sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf
sudo systemctl restart mysql
echo "Please enter the IP address of app server: "
read IP
sudo mysql -u root -p${password} -e "CREATE USER 'root'@'${IP}' IDENTIFIED WITH mysql_native_password BY '${password}';";
sudo mysql -u root -p${password} -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'${IP}' WITH GRANT OPTION;"
sudo mysql -u root -p${password} -e "FLUSH PRIVILEGES;"


Loading…
Отказ
Запис