123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
-
- # PB : TODO -- Prompt if not passed in.
- REPOSERVER=http://git.bbh
- DEFAULTREPOOWNER=chess
- REPOOWNER=$DEFAULTREPOOWNER
- INSTANCENAME=elixir
- INSTANCETYPE=dev
- GITUSER=pb
- GITEMAIL=pradeep@bbh.org.in
-
-
- #OPTIONS
- SKIPPREREQS=true
- SKIPDEVPREREQS=true
-
- if [ "$SKIPPREREQS" = "true" ]; then
- echo "skipping prereqs for firstrun"
- 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 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
-
- 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"
- 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
- fi
-
- sudo mkdir -p /var/chess
- sudo chown $USER:$USER /var/chess
- ROOT=/var/chess/$INSTANCENAME/$INSTANCETYPE
- echo $ROOT
- sudo mkdir -p $ROOT
- cd $ROOT
-
- git clone $REPOSERVER/$REPOOWNER/elxr.git
-
- cd elxr
- npm i
- npm link
- cd ..
-
- # Install mysql
- #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
-
- # Init DB schema and Load Data
- #mysql -u root -pmysql#minA1 < cihsr-data/cihsr-dev-schema.sql
- fi
-
- echo module.exports = { instanceName : "'$INSTANCENAME'", reposerver: "'$REPOSERVER'", gitUser: "'$GITUSER'", gitEmail:"'$GITEMAIL'" } > installchoices.js
- elxr use elixir
- elxr i
|