-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·60 lines (50 loc) · 1.55 KB
/
install.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
#!/bin/bash
fail=false
if [ ! -d /mnt/basaar ] ; then
echo "Create folder /mnt/basaar"
fail=true
fi
if ! which virtualbox &>/dev/null ; then
echo "Virtualbox required" >&2
echo "Install Virtualbox with sudo apt-get install virtualbox"
fail=true
elif [ `vboxmanage --version | sed 's/_.*//' | tr -dc [:digit:]` -lt 4112 ] ; then
echo "Please update your virtualbox"
fail=true
fi
if ! which vagrant &>/dev/null ; then
echo "Vagrant required" >&2
echo "Download latest vagrant from website http://www.vagrantup.com/downloads"
echo "and install."
fail=true
elif [ `vagrant -v | sed 's/.*[ \t]//' | tr -dc [:digit:]` -lt 163 ] ; then
echo "Please update your vagrant"
fail=true
fi
if ! which pip &>/dev/null ; then
echo "pip required" >&2
echo "Install pip with sudo apt-get install python-pip"
fail=true
fi
if ! which ansible &>/dev/null ; then
echo "Ansible required" >&2
echo "Install Ansible with sudo pip install ansible"
fail=true
elif [ `ansible --version | sed 's/.*[ \t]//' | tr -dc [:digit:]` -lt 17 ] ; then
echo "Please update your ansible"
fail=true
fi
if $fail ; then
exit 1
fi
vagrant destroy -f && vagrant up
res=$?
if [ $res -gt 0 ] ; then
exit $res
fi
echo "Basaar is successfully installed. To run server login to"
echo "vagrant box using 'vagrant ssh' command and run command"
echo "/home/vagrant/basaar/sites/basaar/manage.py runserver 0.0.0.0:8000"
echo "Source code is located in host machine /mnt/basaar, you can use that"
echo "with your favourite IDE. :-)"
exit 0