|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
su - vagrant
|
|
|
|
### Setup NPM globals and create necessary directories ###
|
|
|
|
sudo apt-get install phantomjs zsh exuberant-ctags
|
|
|
|
mkdir /home/vagrant/npm
|
|
|
|
mkdir -p /vagrant/flarum/core
|
|
|
|
sudo chown -R vagrant:vagrant /home/vagrant
|
|
|
|
npm install -g bower ember
|
|
|
|
cp /vagrant/scripts/aliases ~/.aliases
|
|
|
|
|
|
|
|
### Create rc file ###
|
|
|
|
if [ -e "/home/vagrant/.zshrc" ]
|
|
|
|
then
|
|
|
|
echo "source ~/.aliases" >> ~/.zshrc
|
|
|
|
else
|
|
|
|
echo "source ~/.aliases" >> ~/.bashrc
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Set up environment files and database ###
|
|
|
|
cp /vagrant/.env.example /vagrant/.env
|
|
|
|
mysql -u root -proot -e 'create database flarum'
|
|
|
|
### Setup flarum/core ###
|
|
|
|
cd /vagrant/flarum/core
|
|
|
|
git clone https://github.com/flarum/core .
|
|
|
|
composer install
|
|
|
|
mkdir public
|
|
|
|
cd /vagrant/flarum/core/ember
|
|
|
|
npm install
|
|
|
|
bower install
|
|
|
|
|
|
|
|
cd /vagrant
|
|
|
|
composer install
|
|
|
|
php artisan flarum:install
|
|
|
|
php artisan flarum:seed
|