Skip to content

Instantly share code, notes, and snippets.

@gabesullice
Last active August 29, 2015 14:10
Show Gist options
  • Save gabesullice/273538fda7b4258c2a49 to your computer and use it in GitHub Desktop.
Save gabesullice/273538fda7b4258c2a49 to your computer and use it in GitHub Desktop.
Sunpower Reset Function
sunrst () {
if [[ $# < 2 ]]; then
echo "You must specify at least an alias and a multisite directory name."
fi
read -p "Would you like to run updates (y/n)? " UPDB
alias=$1
site=$2
cd <path to your sunpower root>/docroot/sites/$site
drush use $site
drush sql-drop -y
drush sql-sync -y --no-cache $alias $site
drush en -y devel ${@:3}
drush vset --yes preprocess_css 0
if [ "$UPDB" == "y" ]; then
drush updb -y
fi
drush cc all
}
@gabesullice
Copy link
Author

This adds a simple function to get the latest db when added to your .bashrc/.bash_profile.

The command takes >= 2 arguments. The first is the alias of the site you want to sync from. The second is the multisite directory to be used. you can specify any number of modules after that to be enabled after sync.

e.g.

sunrst @sunpower.prod-int international stage_file_proxy views_ui

This will sync the international production db to your international local install, then it will enable devel (enabled by default in the script), stage_file_proxy, and views_ui.

@gabesullice
Copy link
Author

Don't forget to edit <path to your sunpower root>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment