Skip to content

Instantly share code, notes, and snippets.

@davidneedham
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidneedham/17e48836ed90de844c64 to your computer and use it in GitHub Desktop.
Save davidneedham/17e48836ed90de844c64 to your computer and use it in GitHub Desktop.
Old bash_profile code that I no longer use, but may still be helpful to reference
# THIS FILE IS OLD AND EXISTS AT THIS POINT FOR EDUCATIONAL PURPOSES ONLY.
# For the latest version, check https://gist.github.com/davidneedham/4014378.
# Refresh the local environment from dev
# ex: gdw-cc projectname dev
# function gdw-cc () {
# ssh -t "$1" gdw-drush "$2" cc all;
# }
# OBSOLITE DUE TO GDW-REFRESH
# #Refresh the local environment from dev
# # ex: gdw-refresh-local projectname
# function gdw-refresh-local () {
# drush sql-sync @ec."$1".dev @ec."$1".local -y --no-cache &&
# drush rsync @ec."$1".dev:%files @ec."$1".local:%files -y
# }
#
# DISABLED IN FAVOR OF DRUSH ALIASES
# Take the db from dev and put it on local, creating new DB if necessary
# alias get_db=gdw_db_get;
# function gdw_db_get () {
# # Did you provide a second argument?
# if [ -z "$2" ]
# then
# # If not, make the $local_db the same as the first argument
# local_db=$1
# else
# # Otherwise, argument 2 is $local_db.
# local_db=$2
# fi
#
# # Check to see if the database already exists
# if [[ ! -z "`mysql -qfsBe "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='$local_db'" 2>&1`" ]];
# then
# # If it does, let the user know we're overwriting the db
# echo "The database '$local_db' already exists, overwriting.";
# else
# # If it doesn't, create the database and let them know
# echo "The database '$local_db' DOES NOT exist, creating.";
# mysql -e "create database $local_db;";
# fi
#
# # Grab a dump of the dev database and import to local db
# ssh -t -C "$1" gdw-drush dev sql-dump | mysql "$local_db";
# }
#
# # Take the database from local and put it on dev.
# alias put_db=gdw_db_put;
# function gdw_db_put () {
# if [ -z "$2" ]
# then
# remote_db=$1
# else
# remote_db=$2
# fi
# drush sql-dump | ssh -t -C "$1" mysql $remote_db;
# echo "The database '$remote_db' has been updated successfully.";
# }
# # Git pull every environment on its.allgoo.de and clear the cache
# # ex: gdw-pull-all projectname
# function gdw-pull-all () {
# ssh -t "$1" gdw -y pull dev &&
# ssh -t "$1" gdw-drush dev cc all &&
# echo 'GIT PULLED DEV' &&
# echo '==================================' &&
# ssh -t "$1" gdw -y pull test &&
# ssh -t "$1" gdw-drush test cc all &&
# echo 'GIT PULLED TEST' &&
# echo '==================================' &&
# ssh -t "$1" gdw -y pull live &&
# ssh -t "$1" gdw-drush live cc all &&
# echo 'GIT PULLED LIVE' &&
# echo '=================================='
# };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment