forked from SUSE/hackweek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·58 lines (43 loc) · 1.95 KB
/
bootstrap.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
#!/bin/bash
# Do not fiddle with my running services when boostrapping.
# Exsepcially annoying in case of virtualbox updates...
export YAST_IS_RUNNING="instsys"
function zypper_with_opts {
zypper --quiet --non-interactive $@
}
function vecho {
echo -e "$@..."
}
vecho "Add repositories for sphinx search engine"
zypper_with_opts addrepo -f 'http://download.opensuse.org/repositories/server:/search/openSUSE_Leap_42.3/server:search.repo'
vecho "Add repositories for ruby"
zypper_with_opts addrepo -f 'http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_42.3/devel:languages:ruby.repo'
vecho "Refresh repositories"
zypper_with_opts --gpg-auto-import-keys refresh
vecho "Update the system from repositories"
zypper_with_opts dup
vecho "Install required packages"
zypper_with_opts install ruby2.2 ruby2.2-devel mariadb sphinx libxml2-devel libxslt-devel sqlite3-devel nodejs gcc-c++ ImageMagick libmysqlclient-devel phantomjs
vecho "Disable versioned gem binary names"
echo 'install: --no-format-executable' >> /etc/gemrc
# FIXME: This is pinned because of https://github.com/bundler/bundler/issues/6535
vecho "Install bundler"
gem.ruby2.2 install bundler -v 1.16.1
vecho "Setup ruby binaries"
ln -sf /usr/bin/ruby.ruby2.2 /usr/local/bin/ruby
for bin in rake rdoc ri; do
/usr/sbin/update-alternatives --set $bin /usr/bin/$bin.ruby.ruby2.2
done
update-alternatives --remove rspec /usr/bin/rspec.ruby2.1-3.4.4
update-alternatives --remove pry /usr/bin/pry.ruby2.1-0.10.3
vecho "Enable MySQL service"
chkconfig mysql on
service mysql start
mysqladmin -u root password 'hackweek'
vecho "Download english morphology dictionary"
wget -q 'http://sphinxsearch.com/files/dicts/en.pak' -O /vagrant/en.pak
vecho "Setting up the Rails environment for 'hackweek'"
su - vagrant -c 'cd /vagrant && bundle && rake dev:bootstrap'
vecho "Your hackweek development box has been set up."
vecho "Start the app with\n\t\t vagrant exec foreman start"
vecho "Happy Hacking!\n\n"