Skip to content

Instantly share code, notes, and snippets.

@dbarbar
Created February 24, 2015 22:48
Show Gist options
  • Save dbarbar/865bee96dbb949f43415 to your computer and use it in GitHub Desktop.
Save dbarbar/865bee96dbb949f43415 to your computer and use it in GitHub Desktop.
update_springboard.sh
#!/bin/bash
# This script downloads the latest 4.x package of Springboard, extracts it to
# docroot, and copies previous git checkouts of the Springboard repos back
# into place. The repos are:
# springboard - modules
# sbsetup - install profile
# springboard_themes - themes
# Existing directory structure:
# projects/4x/
# db - sql and sql.gz files for sql-cli
# docroot - the drupal document root.
# keys - sustainer and encrypt keys
# private - private files directory
#
# Where the projects directory is mapped into a Vagrant VM
# and projects/4x/docroot is the drupal document root.
#
# projects/4x/docroot/sites/default includes a local.settings.php
# with at least the following overrides.
#
# db connection details for local.
# $conf['file_public_path'] = 'sites/default/files';
# $conf['file_private_path'] = '/vagrant/projects/4x/private';
# $conf['encrypt_secure_key_path'] = '/vagrant/projects/4x/keys';
# $conf['cron_safe_threshold'] = false;
# $conf['salesforce_queue_cron_enabled'] = false;
# $conf['fundraiser_standalone_cron_enabled'] = true;
# The script starts here.
# This url is always the latest build package of 4.x.
curl -OL https://packages.jacksonriverdev.com/springboard-7.x-4.x-mtsb.tar.gz
# Move the repo and sites/default directories to the current dir to avoid
# deleting them.
# Need to sudo this because of settings.php permissions.
sudo mv docroot/sites/default .
mv docroot/profiles/sbsetup .
mv docroot/sites/all/modules/springboard .
mv docroot/sites/all/themes/springboard_themes .
# Recreate the docroot and extract the Springboard package there.
sudo rm -rf docroot
mkdir docroot
mv springboard-7.x-4.x-mtsb.tar.gz docroot/
cd docroot
tar zxvf springboard-7.x-4.x-mtsb.tar.gz
# Remove the directories we're going to move back into place.
rm -rf sites/default
rm -rf profiles/sbsetup
rm -rf sites/all/modules/springboard
rm -rf sites/all/themes/springboard_themes
cd ..
# Move the directories back into place.
sudo mv default docroot/sites
mv sbsetup docroot/profiles
mv springboard docroot/sites/all/modules
mv springboard_themes docroot/sites/all/themes
# Don't need the package archive any more.
rm -f docroot/springboard-7.x-4.x-mtsb.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment