Exemplo n.º 1
0
def provision_vagrant():
    vagrant()
    update_index()
    fabtools.require.postfix.server('example.com')
    create_pg_database()
    update_requirements()
    django_manage("migrate")
    django_migrate()
Exemplo n.º 2
0
def vagrant(name=''):
    """
    optional command `fab vagrant <something>`
    sets the public key for root and then switches to the root user
    """
    from fabtools import vagrant as _vagrant
    _vagrant.vagrant(name)
    env['host_string'] = env['host_string'].replace('vagrant', 'root')
Exemplo n.º 3
0
def vagrant(name=''):
    """
    optional command `fab vagrant <something>`
    sets the public key for root and then switches to the root user
    """
    from fabtools import vagrant as _vagrant
    _vagrant.vagrant(name)
    env['host_string'] = env['host_string'].replace('vagrant', 'root')
Exemplo n.º 4
0
def vagrant(name=''):
    """
    optional command `fab vagrant <something>`
    sets the public key for root and then switches to the root user
    """
    from fabtools import vagrant as _vagrant
    _vagrant.vagrant(name)
    sudo('rsync -az /home/vagrant/.ssh/ /root/.ssh/')
    sudo('chown -R root: /root/.ssh')
    env['host_string'] = env['host_string'].replace('vagrant', 'root')
Exemplo n.º 5
0
def vagrant(name=''):
    """
    optional command `fab vagrant <something>`
    sets the public key for root and then switches to the root user
    """
    from fabtools import vagrant as _vagrant
    _vagrant.vagrant(name)
    sudo('rsync -az /home/vagrant/.ssh/ /root/.ssh/')
    sudo('chown -R root: /root/.ssh')
    env['host_string'] = env['host_string'].replace('vagrant', 'root')
Exemplo n.º 6
0
def status():
    vagrant()
    run('sudo service couchdb status')
    run('sudo service nginx status')
    with cd(VAGRANT_HOME):
        run('hg status')
Exemplo n.º 7
0
def update():
    vagrant()
    with cd(VAGRANT_HOME):
        run('hg pull -u')
Exemplo n.º 8
0
def dev():
    """Local dev environment."""
    env.is_dev = True
    env.app_root = '/vagrant/'
    vagrant()
Exemplo n.º 9
0
env.dbname = "devsite_django"

# Location where Fabric can store db-related files, with trailing /
env.encfab = "/mnt/encrypted/fabric/"

# Configure the Vagrant VM as the default target of our commands, so long as no
# hosts were specified on the command line. Calling vagrant() is sort of like
# writing env.hosts = ["vagrant"], but it handles the hostname and SSH config
# properly.
#
# This means that run() and sudo() will execute on the Vagrant VM by default.
#
if not env.hosts:
    try:
        from fabtools.vagrant import vagrant
        vagrant()
    except SystemExit:
        print ""
        print "***** "
        print "***** Fabric encountered a fatal exception when loading the Vagrant configuration!"
        print "***** Make sure that Vagrant is running:"
        print "*****"
        print "*****   $ vagrant status"
        print "*****   $ vagrant up"
        print "***** "

        raise


@task
def setup():
Exemplo n.º 10
0
def create_superuser():
    vagrant()
    django_manage("createsuperuser [email protected]", True)
Exemplo n.º 11
0
def create_superuser():
    vagrant()
    django_manage("createsuperuser [email protected]", True)
Exemplo n.º 12
0
env.dbname = "devsite_django"

# Location where Fabric can store db-related files, with trailing /
env.encfab = "/mnt/encrypted/fabric/"

# Configure the Vagrant VM as the default target of our commands, so long as no
# hosts were specified on the command line. Calling vagrant() is sort of like
# writing env.hosts = ["vagrant"], but it handles the hostname and SSH config
# properly.
#
# This means that run() and sudo() will execute on the Vagrant VM by default.
#
if not env.hosts:
    try:
        from fabtools.vagrant import vagrant
        vagrant()
    except SystemExit:
        print ""
        print "***** "
        print "***** Fabric encountered a fatal exception when loading the Vagrant configuration!"
        print "***** Make sure that Vagrant is running:"
        print "*****"
        print "*****   $ vagrant status"
        print "*****   $ vagrant up"
        print "***** "

        raise

@task
def setup():
    """