Last active
August 29, 2015 14:07
-
-
Save davit/6da4198a672769d0c2d2 to your computer and use it in GitHub Desktop.
Download and install drupal using drush (by no means should this be used in an unsafe environment)
This file contains hidden or 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 | |
drupal_version=$1 | |
site_name=$2 | |
db_user=$3 | |
db_pass=$4 | |
db_name=$5 | |
function print_usage() { | |
echo -e "Usage: $0 drupal_version site_name db_user db_pass db_name" | |
} | |
if [[ ( $1 == "--help") || ( $1 == "-h" ) ]]; then | |
print_usage | |
exit 0 | |
elif [[ "$#" -eq 0 ]]; then | |
print_usage | |
exit 1 | |
fi | |
#cd /var/www/$contextRoot/web | |
drupal=drupal-${drupal_version} | |
echo "Downloading ${drupal}..." | |
drush dl $drupal | |
echo "Changing drupal folder to the site name: ${site_name}" | |
sudo mv $drupal $site_name | |
echo "Entering $site_name folder..." | |
cd $site_name | |
echo "Installing drupal..." | |
drush -y site-install standard --account-name=admin --account-pass=admin \ | |
--db-url=mysql://${db_user}:${db_pass}@localhost/${db_name} | |
echo "Setting the site nane..." | |
drush variable-set site_name ${site_name} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment