Skip to content

Instantly share code, notes, and snippets.

@cosmicdreams
Forked from timplunkett/setupd8
Last active August 29, 2015 14:14
Show Gist options
  • Save cosmicdreams/0e3eba63ac94498b57af to your computer and use it in GitHub Desktop.
Save cosmicdreams/0e3eba63ac94498b57af to your computer and use it in GitHub Desktop.
#!/bin/bash
# Drop the existing database, if any.
drush sql-drop -y;
# Remove the files from a previous install.
sudo rm -rf sites/default;
# Restore the directories and files that are included by Drupal.
sudo git checkout -- sites/default;
# Fix permissions and ownership problems caused by sudo.
sudo chmod -R 777 sites/default;
sudo chown -R `whoami` sites/default;
# Because we are paranoid, do it again?!
sudo git checkout -- sites/default;
sudo chown -R `whoami` sites/default;
# Uncomment the next line if you want to install via the UI.
#exit
# Allow an install profile to be specified.
if [ $1 ] ; then
drush si $1 --db-url=mysql://root:root@localhost/d8 -y
else
drush si --db-url=mysql://root:root@localhost/d8 -y
fi
# Enable the development settings (disable CSS/JS aggregation, render caches, etc.)
sudo cp sites/example.settings.local.php sites/default/settings.local.php
echo "include __DIR__ . '/settings.local.php';" | sudo tee -a sites/default/settings.php > /dev/null
# Enable simpletest.module
drush en simpletest -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment