forked from acquia/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-drupal.sh
executable file
·34 lines (26 loc) · 1.03 KB
/
install-drupal.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
SITE_DIR=$(pwd)/docroot/sites/default
SETTINGS=$SITE_DIR/settings.php
DB_URL=${DB_URL:-sqlite://db.sqlite}
# Delete previous settings.
if [[ -f $SETTINGS ]]; then
chmod +w $SITE_DIR $SETTINGS
rm $SETTINGS
fi
# Install Drupal.
drush site:install lightning --yes --config ./drush.yml --account-pass admin --db-url $DB_URL
# Make settings writable.
chmod +w $SITE_DIR $SETTINGS
# Copy development settings into the site directory.
cp settings.local.php $SITE_DIR
# Add Acquia Cloud subscription info to settings.php.
echo "if (file_exists('/var/www/site-php')) {" >> $SETTINGS
echo " require '/var/www/site-php/lightningnightly/lightningnightly-settings.inc';" >> $SETTINGS
echo " \$settings['install_profile'] = 'standard';" >> $SETTINGS
echo "}" >> $SETTINGS
echo "else {" >> $SETTINGS
echo " require __DIR__ . '/settings.local.php';" >> $SETTINGS
echo "}" >> $SETTINGS
echo "require __DIR__ . '/settings.local.php';" >> $SETTINGS
# Copy PHPUnit configuration into core directory.
cp -f phpunit.xml ./docroot/core