Created
April 18, 2016 09:55
-
-
Save Luukyb/c45902ce7f30e9d870b3ffef9d6349c6 to your computer and use it in GitHub Desktop.
Drupal build update 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 | |
echo "Executing build for upgrade" | |
echo "" | |
echo "Registry rebuild" | |
drush rr | |
echo "" | |
# You can run this script with the argument dev. | |
dev_setup=false | |
if [[ $# -eq 1 ]]; then | |
if [[ $1 = "dev" ]]; then | |
dev_setup=true | |
fi | |
fi | |
if $dev_setup ; then | |
echo "Build script for development" | |
echo "" | |
# Disable modules here. | |
fi | |
echo "Running any required database updates" | |
drush updb -y | |
echo "" | |
# Clear the cache. | |
echo "Clearing cache" | |
drush cc all | |
echo "" | |
# Revert features | |
echo "Reverting all features" | |
drush fra -y | |
echo "" | |
# Clear the cache. | |
echo "Clearing cache" | |
drush cc all | |
if $dev_setup ; then | |
echo "Dev: create user admin" | |
drush user-create prometadmin --mail="admin@webizat.com" --password="admin" | |
echo "Dev: add role admin to admin" | |
drush user-add-role "administrator" admin | |
else | |
# Index the nodes in Solr (Uncomment next line when ready) | |
# drush solr-index | |
fi | |
# Clear the cache | |
echo "Clearing cache one last time" | |
drush cc all | |
echo "" | |
echo "" | |
echo "Build completed" | |
if $dev_setup ; then | |
echo "Dev: your connexion token as admin" | |
drush uli admin | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment