-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·144 lines (112 loc) · 3.13 KB
/
bootstrap.sh
File metadata and controls
executable file
·144 lines (112 loc) · 3.13 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/usr/bin/env bash
cat << EOF
|--------------------------------------------------------|
| |
|-- Prepare stage before frameworks installation --|
| |
|--------------------------------------------------------|
EOF
# Install build tools and ntp (to prevent clock skewing)
mkdir build-libs
sudo apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages ntp cmake
# Replace nginx configuration
sudo rm /etc/nginx/sites-enabled/localtest.me
sudo echo "
server {
server_name localhost;
root /vagrant/php/;
listen 80;
location / {
try_files \$uri \$uri;
}
location ~ \.php\$ {
#include /etc/nginx/nginx.conf.fastcgi.cache;
fastcgi_pass unix:/var/run/php.fpm.sock;
include /etc/nginx/nginx.conf.fastcgi;
fastcgi_param VAGRANT vagrant;
}
include /etc/nginx/nginx.conf.sites;
error_log /var/log/nginx/error.log;
}
" > /etc/nginx/sites-available/default
sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
sudo service nginx restart
cat << EOF
|-----------------------------------------|
| |
|-- Install C/C++ REST frameworks --|
| |
|-----------------------------------------|
EOF
# Install CppRestSDK (Casablanca) C++ REST framework
sudo apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages libcpprest-dev
# Install RapidJSON library
# RapidJSON is required for pistache, restbed and POCO samples to produce JSON result
pushd build-libs
git clone https://github.com/Tencent/rapidjson.git
pushd rapidjson
git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
sudo make install
popd
# Install Pistache C++ REST framework
git clone https://github.com/oktal/pistache.git
pushd pistache
git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
sudo make install
popd
# Install Restbed C++ REST framework
git clone --recursive https://github.com/corvusoft/restbed.git
pushd restbed
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
sudo make install
sudo cp -r distribution/library/* /usr/lib/
sudo cp -r distribution/include/* /usr/include/
popd
# Install POCO C++ framework
git clone https://github.com/pocoproject/poco.git
pushd poco
mkdir cmake_build
cd cmake_build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j 8
sudo make install
popd
popd
cat << EOF
|-----------------------------------|
| |
|-- Build benchmark samples --|
| |
|-----------------------------------|
EOF
pushd samples/cpp
pushd cpprestsdk-default_json_impl
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
popd
pushd cpprestsdk-rapidjson
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
popd
pushd pistache
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
popd
pushd restbed
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
popd
pushd poco-default_json_impl
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
popd
pushd poco-rapidjson
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8
popd
popd