Advertisement
pjerky

File: dpfe (Drush pull db, feature revert, and update)

Oct 27th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. SOURCE=$1
  4. DEST=$2
  5.  
  6. if [[ -z "$SOURCE" ]]; then
  7.   read -p "Source Environment: " SOURCE
  8. fi
  9.  
  10. if [[ -z "$DEST" ]]; then
  11.   read -p "Destination Environment: " DEST
  12. fi
  13.  
  14. DATE=`date +%Y-%m-%d_%H%M`
  15.  
  16. echo "Drush commands using Source: ${SOURCE} and Destination: ${DEST}"
  17.  
  18. drush use ${DEST} && drush sql-dump --result-file=~/Downloads/Project\ Backups/My\ Project/local/${DATE}.sql && drush sql-drop -y && drush sql-sync ${SOURCE} ${DEST} -y && drush rr && drush fra -y --force && drush updb -y
  19.  
  20. # You can comment this line out if you do not want to run rsync between the environments
  21. drush rsync ${SOURCE}:%files/ ${DEST}:%files
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement