Example #1
0
def get_remote_db():
    "Download the latest database from the server and load it onto your local database"
    dbsettings = get_db_settings()
    with cd(env.path):
        if dbsettings['engine']=='mysql': 
            run('mysqldump -u%(user)s -p%(pass)s %(name)s > database' % dbsettings )
        elif dbsettings['engine']=='postgresql' or dbsettings['engine']=='postgresql_psycopg2':
            run('psql -u%(user)s -p%(pass)s %(name)s > database' % dbsettings)
    
    get(env.path+'/database', 'database')
    if dbsettings['engine']=='mysql': 
        local('echo "create database if not exists %(name)s;" | mysql -u%(user)s -p%(pass)s' % dbsettings)
        local('mysql -u%(user)s -p%(pass)s %(name)s < database' % dbsettings)
    elif dbsettings['engine']=='postgresql' or dbsettings['engine']=='postgresql_psycopg2':
        run('echo "create database if not exists %(name)s;" | psql -u%(user)s -p%(pass)s' % dbsettings)
Example #2
0
def get_remote_db():
    "Download the latest database from the server and load it onto your local database"
    dbsettings = get_db_settings()
    with cd(env.path):
        if dbsettings['engine'] == 'mysql':
            run('mysqldump -u%(user)s -p%(pass)s %(name)s > database' %
                dbsettings)
        elif dbsettings['engine'] == 'postgresql' or dbsettings[
                'engine'] == 'postgresql_psycopg2':
            run('psql -u%(user)s -p%(pass)s %(name)s > database' % dbsettings)

    get(env.path + '/database', 'database')
    if dbsettings['engine'] == 'mysql':
        local(
            'echo "create database if not exists %(name)s;" | mysql -u%(user)s -p%(pass)s'
            % dbsettings)
        local('mysql -u%(user)s -p%(pass)s %(name)s < database' % dbsettings)
    elif dbsettings['engine'] == 'postgresql' or dbsettings[
            'engine'] == 'postgresql_psycopg2':
        run('echo "create database if not exists %(name)s;" | psql -u%(user)s -p%(pass)s'
            % dbsettings)
Example #3
0
def put_local_db():
    "Dump your local database and load it onto the servers databse"
    dbsettings = get_db_settings()
    if dbsettings['engine']=='mysql': 
        local('mysqldump -u%s -p%s %s > database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
        put('database', 'database')
        local('mysql -u%s -p%s %s < database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
    elif dbsettings['engine']=='postgresql' or dbsettings['engine']=='postgresql_psycopg2':
        local('mysqldump -u%s -p%s %s > database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
        put('database', 'database')
        local('mysql -u%s -p%s %s < database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
Example #4
0
def put_local_db():
    "Dump your local database and load it onto the servers databse"
    dbsettings = get_db_settings()
    if dbsettings['engine'] == 'mysql':
        local('mysqldump -u%s -p%s %s > database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
        put('database', 'database')
        local('mysql -u%s -p%s %s < database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
    elif dbsettings['engine'] == 'postgresql' or dbsettings[
            'engine'] == 'postgresql_psycopg2':
        local('mysqldump -u%s -p%s %s > database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
        put('database', 'database')
        local('mysql -u%s -p%s %s < database' %\
        (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME))
Example #5
0
def checkout_local():
    local('svn co %s %s' % (env.svnurl, env.path))
Example #6
0
def add(file):
    "Add files to the repository"
    local('svn add %s' % file)
Example #7
0
def commit():
    "Save changes to version control"
    local('svn commit')
Example #8
0
def update_local():
    "Pull changes from version control"
    local('svn update')
Example #9
0
def commit():
    "Save changes to version control"
    local('git commit -a')
Example #10
0
def update_local():
    "Pull changes from version control"
    local('git pull')
Example #11
0
def update_local():  
    "Pull changes from version control"
    local('git pull')
Example #12
0
def checkout_local():
    local('svn co %s %s' % (env.svnurl, env.path))
Example #13
0
def add(file):
    "Add files to the repository"
    local('svn add %s' %file)
Example #14
0
def commit():
    "Save changes to version control"
    local('svn commit')
Example #15
0
def update_local():  
    "Pull changes from version control"
    local('svn update')
Example #16
0
def commit():
    "Save changes to version control"
    local('git commit -a')
Example #17
0
def push():
    "Pull changes from version control"
    local('git push')
Example #18
0
def push():
    "Pull changes from version control"
    local('git push')