-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit_script
More file actions
121 lines (110 loc) · 3.87 KB
/
init_script
File metadata and controls
121 lines (110 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
#
INSTANCE="ubuntu"
UNAMEX="ubuntu"
WEBSITENAME="nsfcareer-react-website"
HOST=""
cd /home/$UNAMEX
echo "========================================================="
echo "ENTER SINGLE HOST NAME with http:// suffix. Please don't"
echo "add "\"/"\" at the end of the URL"
echo "e.g : http://digitalbrainjury.com , http://nsfcareer.io"
echo "========================================================="
echo ""
read -p "Enter DOMAIN NAME: " HOST
echo ""
echo $UNAMEX
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install nginx -y
sudo systemctl enable nginx
# sudo apt-get update -y
sudo apt-get install build-essential libssl-dev -y
sudo apt install xvfb -y
sudo snap install cmake --classic
sudo apt-get install freeglut3-dev -y
# Python dependencies
sudo apt install python-pip -y
sudo pip install requests
sudo pip install pillow
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y npm
sudo npm i -g npx
cd /home/$UNAMEX
echo "
server {
listen 80;
server_name $HOST;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-for \$proxy_add_x_forwarded_for;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
}
location /api {
proxy_pass http://127.0.0.1:3001/api;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-for \$proxy_add_x_forwarded_for;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
}
}" > /etc/nginx/sites-available/default
#
# at this step you need to update A record on google domains
#
sudo systemctl reload nginx
# Cloning specific brach of React website
# git clone https://github.com/PSUCompBio/nsfcareer-react-website.git
git clone https://github.com/vradars/nsfcareer-react-website.git
cd /home/$UNAMEX/$WEBSITENAME
sudo npm install
sudo npm install -g concurrently
sudo npm install -g nodemon
# sudo npm run build
sudo npm install -g serve
sudo npm install pm2 -g
sudo npm i -g babel-cli
cd /home/$UNAMEX/$WEBSITENAME/client/
echo -n "export const ENDPOINT = "\"$HOST/api/"\" ;" > ./src/config/constants.js
sudo npm install
export PM2_HOME=/home/$UNAMEX/.pm2
cd /home/$UNAMEX/
curl -L https://www.vtk.org/files/release/8.2/VTK-8.2.0.tar.gz > VTK.tar.gz
tar -xvzf VTK.tar.gz
curl -L https://www.vtk.org/files/release/8.2/VTKData-8.2.0.tar.gz > VTK_DATA.tar.gz
tar -xvzf VTK_DATA.tar.gz
mv VTK-8.2.0/ VTK
cd VTK
mkdir build
cd build
cmake VTK_DATA_ROOT=/home/$UNAMEX/VTK -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
sudo make install -j 8
export LD_LIBRARY_PATH=/home/$UNAMEX/VTK/build/bin:/home/$UNAMEX/VTK/build/lib
export VTK_ROOT="/home/$UNAMEX/VTK/" >> /home/$UNAMEX/.bash_profile
git clone https://github.com/PSUCompBio/ProjectedTexture-VTK
cd ProjectedTexture-VTK/
mkdir build
cd build/
cmake -DVTK_DIR:PATH=/home/$UNAMEX/VTK/build/ make -j 8 ..
make
cp ProjectedTexture /home/$UNAMEX/$WEBSITENAME/config/
cd /home/$UNAMEX/$WEBSITENAME/
echo "====================================================================="
echo "| **** VERY IMPORTANT STEP ***** |"
echo "====================================================================="
echo "* Now Update the AWS Credentials and other variables in file given "
echo " below !"
echo ""
echo "---------------------------------------------------------------------"
echo "* Execute the command given below to open & Edit in Vi Editor"
echo " sudo vi $PWD/config/configuration_keys.json "
echo "======================================================================"
echo ""