Skip to content

Instantly share code, notes, and snippets.

@esolitos
Last active June 22, 2019 08:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esolitos/d1498b392fca5cde5a4c to your computer and use it in GitHub Desktop.
Save esolitos/d1498b392fca5cde5a4c to your computer and use it in GitHub Desktop.
Creates a new _Ramsalt Media_ platform and sets it up with Esolitos' default configuration.
#!/bin/sh
#
# Creates a new RamsaltMedia platform and sets it up with Esolitos' default configuration.
#
DRUSH=`which drush`
if [ -z $DRUSH ]; then
echo "ERROR: drush command not found!" 1>&2
exit -1
fi;
DRUPAL_FILES_DIR="/var/www/drupal_files" # TODO: Use parameter and/or sensitive default
PLATFORM_VERS='0.3-dev' # TODO: Use parameter
datestamp=`date "+%Y%m%d"`
platform_settings_gists_url="https://gist.githubusercontent.com/esolitos/692e1b81209053ae9be5/raw/59bc888d069e47f80ce3d271dbb53ea1cee122c2"
makefile_url="https://raw.githubusercontent.com/ramsalt/DrupalMakes/master/dists/ramsaltmedia/platform-7.x-$PLATFORM_VERS.build"
dest_dir="platform-media-$PLATFORM_VERS-$datestamp"
if [ ! -w . ]; then
echo "ERROR: Unable to write the destination directory: `pwd`" 1>&2
exit -1
elif [ -d $dest_dir ]; then
echo "ERROR: Destination directory already existing! I'm refusing to overwrite a platform, please remove it before running this script." 1>&2
echo "Destination was: $dest_dir" 1>&2
exit -1
fi
#drush_options="--concurrency=5 --force-complete --working-copy --verbose"
drush_options="--concurrency=5 --force-complete --working-copy"
drush make $drush_options $makefile_url $dest_dir
cd "$dest_dir/sites"
ln -s "$DRUPAL_FILES_DIR" files
wget "$platform_settings_gists_url/platform.settings.php"
wget "$platform_settings_gists_url/settings.php" -O "default/ramsaltmedia.settings.php"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment