/
stackato-setup.sh
50 lines (39 loc) · 1.27 KB
/
stackato-setup.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#echo "This script does Stackato setup related to filesystem."
#echo "This script also handles Drupal Setup."
FS=$STACKATO_FILESYSTEM
SAR=$STACKATO_APP_ROOT
DRUSH=http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
if ! [ -s $HOME/index.php ]
then
# create folders in the shared filesystem
mkdir -p $FS/sites
# download required files
echo "Downloading Drush and Drupal..."
curl -sfS $DRUSH | tar xzf -
mv drush $SAR
$SAR/drush/drush dl drupal --drupal-project-rename=drupal --yes
mv drupal/* drupal/.??* .
rmdir drupal
fi
echo "Migrating data to shared filesystem..."
cp -r sites/* $FS/sites
echo "Symlink to folders in shared filesystem..."
rm -fr sites
ln -s $FS/sites sites
# allow custom profile installations (if exist)
if [ -s custom-profile.sh ]
then
bash custom-profile.sh
fi
if ! [ -e $FS/INSTALLED ]
then
echo "Installing Drupal..."
$SAR/drush/drush -r $HOME site-install -y --db-url=$DATABASE_URL --account-name=admin --account-pass=passwd --site-name=Stackato --locale=en-US
echo "Installing Drupal modules..."
$SAR/drush/drush -r $HOME dl pathauto,views --yes
$SAR/drush/drush -r $HOME en pathauto,views_ui --yes
# Drupal successfully installed
touch $FS/INSTALLED
fi
echo "All Done!"