Skip to content

Instantly share code, notes, and snippets.

@keopx
Last active April 25, 2017 17:18
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save keopx/44aee08e553f653bf471 to your computer and use it in GitHub Desktop.
Drupal 8 reinstall site script
#!/bin/bash
cd drupal
sudo rm -fr vendor
composer install
sudo chmod 777 sites/default
cd sites/default
rm -fr settings.php services.yml
# for developers only (sets up some dev mode settings, do this before install!)
cp ../example.settings.local.php ./settings.local.php
# for everyone
cp default.settings.php settings.php
cp default.services.yml services.yml
chmod 0666 settings.php services.yml
sudo rm -fr files
mkdir files
sudo chown keopx:www-data files # NB this is server/user specific!
chmod 0775 files
# Add local env setup
echo 'Set local settings file before install'.
sed -i 's/# if (file_exists/if (file_exists/' settings.php
sed -i 's/# include $app_root/ include $app_root/' settings.php
sed -i 's/# }/}/' settings.php
sed -i 's/# $settings/$settings/' settings.local.php
drush si standard --db-url=mysql://drupal8_contrib:drupal8_contrib@mysql/drupal8_contrib --site-name="drupal test" --account-name=root --account-pass=root --account-mail=keopx@keopx.net -y
drush en admin_toolbar admin_toolbar_tools -y
drush cr
drush en admin_toolbar admin_toolbar_tools -y
drush cr
echo 'Done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment