Drupal 8 reinstall site script
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
#!/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