Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 5
0
def checkout_local():
    local('svn co %s %s' % (env.svnurl, env.path))
Ejemplo n.º 6
0
def add(file):
    "Add files to the repository"
    local('svn add %s' % file)
Ejemplo n.º 7
0
def commit():
    "Save changes to version control"
    local('svn commit')
Ejemplo n.º 8
0
def update_local():
    "Pull changes from version control"
    local('svn update')
Ejemplo n.º 9
0
def commit():
    "Save changes to version control"
    local('git commit -a')
Ejemplo n.º 10
0
def update_local():
    "Pull changes from version control"
    local('git pull')
Ejemplo n.º 11
0
def update_local():  
    "Pull changes from version control"
    local('git pull')
Ejemplo n.º 12
0
def checkout_local():
    local('svn co %s %s' % (env.svnurl, env.path))
Ejemplo n.º 13
0
def add(file):
    "Add files to the repository"
    local('svn add %s' %file)
Ejemplo n.º 14
0
def commit():
    "Save changes to version control"
    local('svn commit')
Ejemplo n.º 15
0
def update_local():  
    "Pull changes from version control"
    local('svn update')
Ejemplo n.º 16
0
def commit():
    "Save changes to version control"
    local('git commit -a')
Ejemplo n.º 17
0
def push():
    "Pull changes from version control"
    local('git push')
Ejemplo n.º 18
0
def push():
    "Pull changes from version control"
    local('git push')