Skip to content

Instantly share code, notes, and snippets.

@cam8001
Forked from saltednut/dice.sh
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cam8001/34ab84cf10a08ecbe55d to your computer and use it in GitHub Desktop.
Save cam8001/34ab84cf10a08ecbe55d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Usage: dice makefile docroot dbuser dbpass dbname sitename install-profile
drupal_install_clean_env() {
if [[ -r $2 ]]; then
sudo rm -r $2
cd ~/
fi
if [[ -r $1 ]]; then
drush make --working-copy --concurrency=5 $1 $2
cd $2
drush si $7 --db-url=mysql://$3:$4@localhost:3306/$5 --db-su=$3 --db-su-pw=$4 --site-name="$6" --account-name=admin --account-pass=admin -y
# Files directory (local dev)
sudo chmod -R 777 $2/sites/default/files
# Files directory (remote dev/stage/prod)
#sudo chown -R _www:_www $2/sites/default/files
fi
}
alias dice=drupal_install_clean_env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment