-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·75 lines (61 loc) · 2.06 KB
/
install.sh
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
#!/usr/bin/env bash
# Add apt-repos and update
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get -y update
# Install unzip
sudo apt-get -y install unzip
# Install Java
sudo apt-get -y install oracle-java8-installer
# Set JAVA_HOME
if [ "$JAVA_HOME" != '/usr/lib/jvm/java-8-oracle' ]
then
sudo chmod 777 /etc/environment
sudo echo "JAVA_HOME=/usr/lib/jvm/java-8-oracle" >> /etc/environment
source /etc/environment
fi
# Download and unpack source data
wget https://dl.dropboxusercontent.com/s/d2kpw8bcg2zbi6n/pubint_transfer.zip
unzip pubint_transfer.zip
sudo mkdir /var/otp
sudo cp -r pubint_transfer/otp/graphs /var/otp/graphs
# Install MongoDB
sudo apt-get install -y mongodb-org
sudo rm -f /etc/systemd/system/mongodb.service
sudo touch /etc/systemd/system/mongodb.service
sudo bash -c 'cat >/etc/systemd/system/mongodb.service' <<EOT
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
EOT
sudo mkdir /data
sudo mkdir /data/db
sudo chmod 777 /data/db
sudo systemctl enable mongodb
sudo systemctl start mongodb
# Install Maven
sudo apt-get -y install maven
# Clone Git and build
mkdir git
cd git
git clone http://github.com/GBPeters/PubInt
cd PubInt
mvn -U clean package -DskipTests
cd ~
# Restore Mongo Collections
mongorestore -d pubint --archive=~/pubint_transfer/pubint_agent.zip
mongorestore -d pubint --archive=~/pubint_transfer/pubint_user.zip
mongorestore -d pubint --archive=~/pubint_transfer/pubint_anchor.zip
mongorestore -d pubint_v --archive=~/pubint_transfer/pubint_agent.zip
mongorestore -d pubint_v --archive=~/pubint_transfer/pubint_user.zip
mongorestore -d pubint_v --archive=~/pubint_transfer/pubint_anchor.zip
# Clean
rm -r pubint_transfer
rm -r __MACOSX
rm pubint_transfer.zip