2015-12-07 11:40:27 +01:00
|
|
|
#!/bin/bash
|
2016-03-04 15:36:45 +01:00
|
|
|
pushd /vagrant
|
|
|
|
|
|
2015-12-07 11:40:27 +01:00
|
|
|
echo -e "\ninstalling required software packages...\n"
|
2017-07-20 14:37:22 +02:00
|
|
|
zypper -q ar -f http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_42.2/devel:languages:ruby.repo
|
|
|
|
|
zypper -q --gpg-auto-import-keys --non-interactive ref
|
2017-07-14 01:23:03 +05:30
|
|
|
zypper -q -n install update-alternatives ruby2.4-devel make gcc gcc-c++ \
|
2016-03-04 15:36:45 +01:00
|
|
|
libxml2-devel libxslt-devel nodejs screen mariadb \
|
2017-06-18 02:59:28 +03:00
|
|
|
libmysqld-devel sqlite3-devel ImageMagick
|
2015-12-07 11:40:27 +01:00
|
|
|
|
|
|
|
|
echo -e "\ndisabling versioned gem binary names...\n"
|
|
|
|
|
echo 'install: --no-format-executable' >> /etc/gemrc
|
|
|
|
|
|
|
|
|
|
echo -e "\ninstalling bundler...\n"
|
2017-07-14 01:23:03 +05:30
|
|
|
gem.ruby2.4 install bundler
|
2015-12-07 11:40:27 +01:00
|
|
|
|
|
|
|
|
echo -e "\ninstalling your bundle...\n"
|
|
|
|
|
su - vagrant -c "cd /vagrant/; bundle install --quiet"
|
|
|
|
|
|
|
|
|
|
# Configure the database if it isn't
|
|
|
|
|
if [ ! -f /vagrant/config/database.yml ] && [ -f /vagrant/config/database.yml.example ]; then
|
|
|
|
|
echo -e "\nSetting up your database from config/database.yml...\n"
|
|
|
|
|
cp config/database.yml.example config/database.yml
|
2016-03-05 15:15:22 +01:00
|
|
|
if [ ! -f db/development.sqlite3 ] && [ ! -f db/test.sqlite3 ]; then
|
2016-03-04 15:36:45 +01:00
|
|
|
bundle exec rake db:setup
|
|
|
|
|
else
|
|
|
|
|
echo -e "\n\nWARNING: You have already have a development/test database."
|
|
|
|
|
echo -e "WARNING: Please make sure this database works in this vagrant box!\n\n"
|
2016-09-17 19:34:25 -07:00
|
|
|
fi
|
2015-12-07 11:40:27 +01:00
|
|
|
else
|
2017-06-19 14:41:52 +03:00
|
|
|
echo -e "\n\nWARNING: You have already configured your database in config/database.yml."
|
2016-09-17 19:34:25 -07:00
|
|
|
echo -e "WARNING: Please make sure this configuration works in this vagrant box!\n\n"
|
2015-12-07 11:40:27 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo -e "\nProvisioning of your OSEM rails app done!"
|
2016-09-17 19:34:25 -07:00
|
|
|
echo -e "To start your development OSEM run: vagrant exec /vagrant/bin/rails server -b 0.0.0.0\n"
|