This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
vagrant_init_vm.sh
122 lines (87 loc) · 2.2 KB
/
vagrant_init_vm.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
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
#!/bin/bash
# Make sure we are the "vagrant" user
if [[ "$USER" != "vagrant" ]]; then
echo "This script must be run with the 'vagrant' user!."
exit 1
fi
report_step()
{
echo
echo "****************************"
echo "*** $1"
echo "****************************"
echo
}
report_sub_step()
{
echo
echo "*** $1"
echo
}
update_debian_sources()
{
report_step "Debian sources update..."
sudo apt-get update
}
enable_ubuntu_ppa()
{
report_step "Ubuntu PPA activation..."
sudo apt-get install -y python-software-properties
}
install_misc_utils()
{
report_step "Misc utils install (Git, Curl, make, etc.) ..."
sudo apt-get install -y git curl wget build-essential vim udev
# (yeah, we may need udev because of this VM bug :
# http://www.ducea.com/2009/02/18/linux-tips-bash-completion-devfd62-no-such-file-or-directory/
# )
}
install_webmin()
{
report_step "Webmin install..."
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.650_all.deb
sudo dpkg -i webmin_1.650_all.deb
sudo apt-get install -y -f
rm webmin_*
}
install_nodejs()
{
report_step "Node.js install..."
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo add-apt-repository -y ppa:chris-lea/node.js-devel
sudo apt-get update
sudo apt-get install -y nodejs nodejs-devel
}
install_mysql()
{
report_step "MySQL install..."
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
}
install_sqlite()
{
report_step "SQLite install..."
sudo apt-get install -y sqlite3 libsqlite3-dev
}
install_postgresql()
{
report_step "PostgreSQL install..."
sudo apt-get install -y postgresql postgresql-client postgresql-server-dev-all
}
# Ok, let's roll!!
# ######### In Spain, first we update, THEN when install!
update_debian_sources
# ######### We may need some PPA...
enable_ubuntu_ppa
# ######### Misc utils
install_misc_utils
# ######### Webmin may be useful...
install_webmin
# ######### Let's use a recent Node.js version...
install_nodejs
# ######### Node-DBI is a DB abstraction layer.
# Let's install some DB engines !
install_mysql
install_sqlite
install_postgresql
# ######### Finished!
report_step "Finished!"