Created
May 17, 2012 19:55
-
-
Save rlr/2721239 to your computer and use it in GitHub Desktop.
fabfile for getting new db dump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import local | |
def get_db_dump(): | |
local('scp [email protected]:/data/www/sumodump.sql.gz .') | |
local('gunzip sumodump.sql.gz') | |
def load_dump(): | |
local('mysql -e "DROP DATABASE kitsune;"') | |
local('mysql -e "CREATE DATABASE kitsune;"') | |
local('mysql kitsune < sumodump.sql') | |
def schematic(): | |
local('schematic migrations') | |
def anonymize(): | |
local('mysql kitsune < scripts/anonymize.sql') | |
def refresh_db(): | |
get_db_dump() | |
load_dump() | |
anonymize() | |
schematic() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment