-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
productiondeployment.sh
executable file
·100 lines (85 loc) · 2.89 KB
/
productiondeployment.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
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
#!/usr/bin/env bash
chmod +x $0
mkdir ~/yacy
cd ~/yacy
if [ "$1" = 'build' ]
then
#install required dependencies
apt-get install -y git openjdk-8-jdk
apt-get update && apt-get install -y software-properties-common
#install gradle
add-apt-repository ppa:cwchien/gradle -y
apt-get update
apt-get install -y wget
wget https://services.gradle.org/distributions/gradle-3.4.1-bin.zip
mkdir /opt/gradle
apt-get install -y unzip
unzip -d /opt/gradle gradle-3.4.1-bin.zip
export PATH=$PATH:/opt/gradle/gradle-3.4.1/bin
export GRADLE_HOME=/opt/gradle/gradle-3.4.1
export PATH=$PATH:$GRADLE_HOME/bin
gradle -v
#install apache ftp server
wget http://www-eu.apache.org/dist/mina/ftpserver/1.1.0/dist/apache-ftpserver-1.1.0.tar.gz
tar xfz apache-ftpserver-1.1.0.tar.gz
#insall rabbitmq server
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-generic-unix-3.6.6.tar.xz
tar xf rabbitmq-server-generic-unix-3.6.6.tar.xz
apt-get install -y erlang
#install elastic search
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.tar.gz
sha1sum elasticsearch-5.5.0.tar.gz
tar -xzf elasticsearch-5.5.0.tar.gz
#insall yacy_grid_mcp
git clone https://github.com/yacy/yacy_grid_mcp.git
cd yacy_grid_mcp
cat docker/config-ftp.properties > ../apache-ftpserver-1.1.0/res/conf/users.properties
# compile yacygridmcp
gradle build
mkdir data/mcp-8100/conf/ -p
cp docker/config-mcp.properties data/mcp-8100/conf/config.properties
cd ..
#pull and run yacy_grid_parser
git clone --recursive https://github.com/yacy/yacy_grid_parser.git
cd yacy_grid_parser
gradle build
cd ..
#pull and run yacy_grid_crawler
git clone --recursive https://github.com/yacy/yacy_grid_crawler.git
cd yacy_grid_crawler
gradle build
cd ..
#pull and run yacy_grid_loader
git clone --recursive https://github.com/yacy/yacy_grid_loader.git
cd yacy_grid_loader
gradle build
cd ..
adduser --disabled-password --gecos '' elastic
adduser elastic sudo
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
chmod a+rwx ~/yacy/elasticsearch-5.5.0 -R
fi
if [ "$1" = 'run' ]
then
#run all required commands to start all required services
su -m elastic -c '~/yacy/elasticsearch-5.5.0/bin/elasticsearch -Ecluster.name=yacygrid &'
cd ~/yacy/apache-ftpserver-1.1.0
./bin/ftpd.sh res/conf/ftpd-typical.xml &
~/yacy/rabbitmq_server-3.6.6/sbin/rabbitmq-server -detached
sleep 5s;
~/yacy/rabbitmq_server-3.6.6/sbin/rabbitmq-plugins enable rabbitmq_management
~/yacy/rabbitmq_server-3.6.6/sbin/rabbitmqctl add_user yacygrid password4account
echo [{rabbit, [{loopback_users, []}]}]. >> /rabbitmq_server-3.6.6/etc/rabbitmq/rabbitmq.config
~/yacy/rabbitmq_server-3.6.6/sbin/rabbitmqctl set_permissions -p / yacygrid ".*" ".*" ".*"
cd ~/yacy/yacy_grid_mcp
sleep 5s;
gradle run &
sleep 5s;
cd ../yacy_grid_parser
gradle run &
cd ../yacy_grid_crawler
gradle run &
cd ../yacy_grid_loader
gradle run &
cd ..
fi