Skip to content

Instantly share code, notes, and snippets.

@tsphethean
Created June 25, 2013 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsphethean/5857656 to your computer and use it in GitHub Desktop.
Save tsphethean/5857656 to your computer and use it in GitHub Desktop.
Rebuild a drupal 8 site after fresh pull from git.
#!/bin/sh
# Drop old DB
mysql -uroot -e "DROP DATABASE drupal8"
# Create new DB
mysqladmin -uroot create drupal8
# Add permissions
mysql -uroot -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal8.* TO 'drupal8'@'localhost' IDENTIFIED BY 'password'"
# Tidy up site files
sudo chmod a+w ~/Sites/drupal/sites/default
sudo rm -rf ~/Sites/drupal/sites/default/files
rm ~/Sites/drupal/sites/default/settings.php
# Create settings.php
chmod a+w ~/Sites/drupal/sites/default
mkdir ~/Sites/drupal/sites/default/files
chmod a+w ~/Sites/drupal/sites/default/files
cp ~/Sites/drupal/sites/default/default.settings.php ~/Sites/drupal/sites/default/settings.php
chmod a+w ~/Sites/drupal/sites/default/settings.php
# Site install
sudo -u _www drush si standard --account-mail=test@example.com --account-name=admin --account-pass=password --db-url=mysql://drupal8:password@127.0.0.1/drupal8
sudo chmod -R 777 ./sites/default/files
sudo -u _www drush en simpletest -y
sudo -u _www drush dis overlay -y
sudo chmod -R 777 ./sites/default/settings.php
sudo chmod -R 644 ./sites/default/settings.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment