Permalink
Browse files

Implemented stackato-setup.sh for setting up drupal

  • Loading branch information...
1 parent f6556b1 commit 6c24fb8899660d3d9e491e56cedebd2957adffa9 @shsu shsu committed Oct 26, 2012
Showing with 45 additions and 26 deletions.
  1. +44 −0 stackato-setup.sh
  2. +1 −26 stackato.yml
View
@@ -0,0 +1,44 @@
+#!/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.7.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
+
+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!"
View
@@ -10,32 +10,7 @@ services:
${name}-fs: filesystem
hooks:
post-staging:
- # First we get drush and put it in the app root (more secure).
- - curl -sfS http://ftp.drupal.org/files/projects/drush-7.x-5.1.tar.gz | tar xzf -
- - mv drush "$STACKATO_APP_ROOT"/
-
- # Then we use drush to download drupal (and move it to our home directory)
- - $STACKATO_APP_ROOT/drush/drush dl drupal --drupal-project-rename=drupal --yes
- - mv drupal/* drupal/.??* .
- - rmdir drupal
-
- # create sites in the shared filesystem and migrate
- - mkdir -p "$STACKATO_FILESYSTEM"/sites
- - cp -r sites/* "$STACKATO_FILESYSTEM"/sites/
-
- # remove unused directories
- - rm -rf sites
-
- # link to sites folder in the shared filesystem
- - ln -s "$STACKATO_FILESYSTEM"/sites sites
-
- # This does the full install.
- - $STACKATO_APP_ROOT/drush/drush -r $HOME site-install -y --db-url=$DATABASE_URL --account-name=admin --account-pass=passwd --site-name=Stackato --locale=en-US
-
- # Download and enable a few sample modules
- - $STACKATO_APP_ROOT/drush/drush -r $HOME dl pathauto,views --yes
- - $STACKATO_APP_ROOT/drush/drush -r $HOME en pathauto,views_ui --yes
-
+ - sh stackato-setup.sh
pre-running:
# Workaround to pass $VCAP_SERVICES to cron
- echo $VCAP_SERVICES | tee $STACKATO_APP_ROOT/VCAP_SERVICES.json

0 comments on commit 6c24fb8

Please sign in to comment.