-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathbootstrap.sh
More file actions
110 lines (87 loc) · 2.76 KB
/
Copy pathbootstrap.sh
File metadata and controls
110 lines (87 loc) · 2.76 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
#!/usr/bin/env bash
cat << EOF
|--------------------------------------------------------|
| |
|-- Prepare stage before frameworks installation --|
| |
|--------------------------------------------------------|
EOF
# Install build tools and ntp (to prevent clock skewing)
sudo mkdir /tmp/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 and restbed samples to produce JSON result
cd /tmp/build-libs
git clone https://github.com/miloyip/rapidjson
cd rapidjson
git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release .
make
sudo make install
# Install Pistache C++ REST framework
cd /tmp/build-libs
git clone https://github.com/oktal/pistache.git
cd pistache
git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release .
make
sudo make install
# Install Restbed C++ REST framework
cd /tmp/build-libs
git clone --recursive https://github.com/corvusoft/restbed.git
cd restbed
cmake -DCMAKE_BUILD_TYPE=Release .
make
sudo make install
sudo cp -r distribution/library/* /usr/lib/
sudo cp -r distribution/include/* /usr/include/
cat << EOF
|-----------------------------------|
| |
|-- Build benchmark samples --|
| |
|-----------------------------------|
EOF
cd /vagrant/cpp/cpprestsdk-default_json_impl
cmake -DCMAKE_BUILD_TYPE=Release .
make
cd /vagrant/cpp/cpprestsdk-rapidjson
cmake -DCMAKE_BUILD_TYPE=Release .
make
cd /vagrant/cpp/pistache
cmake -DCMAKE_BUILD_TYPE=Release .
make
cd /vagrant/cpp/restbed
cmake -DCMAKE_BUILD_TYPE=Release .
make