Created
March 5, 2014 19:45
-
-
Save allebb/9375034 to your computer and use it in GitHub Desktop.
BindHub specific configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo ">>> Installing BindHub specific customisations..." | |
laravel_root_folder="/vagrant" | |
# Test if Composer is installed | |
composer --version > /dev/null 2>&1 | |
COMPOSER_IS_INSTALLED=$? | |
if [ $COMPOSER_IS_INSTALLED -gt 0 ]; then | |
echo "ERROR: The Laravel framework requires Composer" | |
exit 1 | |
fi | |
# Test if Apache or Nginx is installed | |
nginx -v > /dev/null 2>&1 | |
NGINX_IS_INSTALLED=$? | |
if [ $NGINX_IS_INSTALLED -eq 0 ]; then | |
nginx_root=$(echo "$laravel_root_folder/public" | sed 's/\//\\\//g') | |
# Change default vhost created | |
sed -i "s/root \/vagrant/root $nginx_root/" /etc/nginx/sites-available/vagrant | |
sudo service nginx reload | |
fi | |
# Create a new 'Bindhub' development database... | |
mysql -u root -proot -e "CREATE DATABASE bindhub;" | |
# Lets change into the application directory ready to run the final bits... | |
cd $laravel_root_folder | |
# Lets now install our dependencies... | |
composer install | |
# Lets also migrate and seed our development database... | |
php artisan migrate --seed | |
echo ">>> Provisioning complete! " | |
echo "" | |
echo "You can now access the application at: http(s)://dev.autono.de" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment