forked from ceph/radosgw-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·42 lines (40 loc) · 1.19 KB
/
bootstrap
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
#!/bin/sh
set -e
if command -v lsb_release >/dev/null 2>&1; then
case "$(lsb_release --id --short)" in
Ubuntu|Debian)
for package in python-virtualenv; do
if [ "$(dpkg --status -- $package 2>/dev/null|sed -n 's/^Status: //p')" != "install ok installed" ]; then
# add a space after old values
missing="${missing:+$missing }$package"
fi
done
if [ -n "$missing" ]; then
echo "$0: missing required packages, please install them:" 1>&2
echo " sudo apt-get install $missing"
exit 1
fi
;;
esac
else
if [ -f /etc/redhat-release ]; then
case "$(cat /etc/redhat-release | awk '{print $1}')" in
CentOS)
for package in python-virtualenv; do
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
missing="${missing:+$missing }$package"
fi
done
if [ -n "$missing" ]; then
echo "$0: missing required packages, please install them:" 1>&2
echo " sudo yum install $missing"
exit 1
fi
;;
esac
fi
fi
test -d virtualenv || virtualenv virtualenv
./virtualenv/bin/python setup.py develop
./virtualenv/bin/pip install -r requirements.txt -r requirements-dev.txt
test -e radosgw-agent || ln -s ./virtualenv/bin/radosgw-agent .