Created
November 4, 2014 19:38
-
-
Save anonymous/e4dc49f7149129fe0dd9 to your computer and use it in GitHub Desktop.
Short script to install Drupal application.
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 | |
# Script to install Drupal app | |
# Be careful using database credentials, this script is meant to be used on development server, to speed things up. | |
dbuser="root" | |
dbpass="root" | |
sites_path="~/Sites" | |
if [ $# -lt 1 ]; | |
then | |
echo "Usage: install_drupal.sh appname [dbname]" | |
exit | |
fi | |
appname=$1 | |
if [ $# -eq 2 ]; | |
then | |
dbname=$2 | |
else | |
dbname="db_$1" | |
fi | |
current_path=`pwd` | |
cd $sites_path | |
echo "About to installing application $appname on database $dbname." | |
echo "Downloading Drupal..." | |
drush dl drupal --drupal-project-rename=$appname | |
cd $appname | |
echo "Installing Drupal..." | |
drush site-install --db-url="mysql://$dbuser:$dbpass@localhost/$dbname" --site-name=$appname | |
echo "Done." | |
cd $current_path; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment