forked from tgrabiec/tomcat-bench
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-host.sh
executable file
·63 lines (45 loc) · 1.33 KB
/
setup-host.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
#!/usr/bin/env bash
set -e
function warn()
{
echo "WARN: $@"
}
SRC_BASE=~/src
if [ ! -e $SRC_BASE/FrameworkBenchmarks ]; then
git clone https://github.com/tgrabiec/FrameworkBenchmarks.git ${SRC_BASE}/FrameworkBenchmarks
fi
echo "Checkout OSv"
if [ ! -e $SRC_BASE/osv ]; then
git clone https://github.com/cloudius-systems/osv.git ${SRC_BASE}/osv
cd ${SRC_BASE}/osv
git submodule update --init
else
cd ${SRC_BASE}/osv
git fetch
git checkout -f ${OSV_VERSION_REF:-origin/master}
git submodule update
fi
echo "Checking out tomcat module"
cd ${SRC_BASE}/osv/apps
git remote add tgrabiec https://github.com/tgrabiec/osv-apps.git || warn "Failed to add remote"
git fetch tgrabiec
git checkout -f ${APPS_VERSION_REF:-tgrabiec/tomcat-perf}
echo "Making tomcat module"
cd ${SRC_BASE}/osv/apps/tomcat
make
echo "Building the test app"
cd ${SRC_BASE}/FrameworkBenchmarks
git fetch
git checkout -f ${TEST_APP_VERSION_REF:-origin/master}
cd servlet
mvn clean install
echo "Copying test app to tomcat module"
cp ${SRC_BASE}/FrameworkBenchmarks/servlet/target/servlet.war ${SRC_BASE}/osv/apps/tomcat/upstream/*/webapps/
echo "Building OSv image"
cd ${SRC_BASE}/osv
rm -rf build/release
make clean
make external && make image=tomcat
echo "Saving the image to a backup file"
cp build/release/usr.img usr.img.original
echo "Done."