Skip to content

Instantly share code, notes, and snippets.

@cesarmiquel
Created September 14, 2012 03:17
Show Gist options
  • Save cesarmiquel/3719586 to your computer and use it in GitHub Desktop.
Save cesarmiquel/3719586 to your computer and use it in GitHub Desktop.
My script to init a Drupal project
#!/bin/bash
# ---------------------------------------------------------------------------------------
# Configuration options
# ---------------------------------------------------------------------------------------
DEFAULT_ADMIN_THEME='rubik' # Other common options: seven - adaptivetheme_admin
DEFAULT_THEME='adaptivetheme' # Other common options: omega - zen - bartik
ADMIN_PASSWORD='<strong-password>'
# ---------------------------------------------------------------------------------------
# Test DRUSH_HOME var is set.
if [ -z "$DRUSH_HOME" ]
then
echo 'Debe setear la variable $DRUSH_HOME para que apunte al comando drush.'
echo 'por ejemplo haciendo: '
echo "export DRUSH_HOME='<path_a_drush>'"
exit 1
fi
DRUSH="/usr/bin/php $DRUSH_HOME/drush.php";
# Modules to disable
MODULES='overlay color'
$DRUSH -y dis $MODULES
# Enable common modules
MODULES='ctools views views_ui views_bulk_operations bulk_export context context_ui devel devel_themer node_reference user_reference commentformsettings nodeformsettings nodequeue entity libraries pathauto strongarm token panels memcache memcache_admin rules rules_admin apachesolr apachesolr_search wysiwyg features'
$DRUSH -y en $MODULES
# Set default admin theme
$DRUSH vset admin_theme $DEFAULT_ADMIN_THEME
$DRUSH vset node_admin_theme 1
# Set default theme
$DRUSH vset theme_default $DEFAULT_THEME
# Set Admin password
$DRUSH user-password admin --password="$ADMIN_PASSWORD"
# This set of modules depend more on the requirements for the site
MODULES='flag flag_actions media media_vimeo media_youtube webform workbench workflow workflow_rules '
$DRUSH -y en $MODULES
# Just in case..
$DRUSH cc all
# Create some users
$DRUSH user-create <username> --mail="<email>" --password="<password>"
$DRUSH user-add-role "administrator" --name <username>
# Exit ok
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment