Ejemplo n.º 1
0
def init():
    # TODO: Use utils.config (after checkout)
    if files.exists(os.path.join(env.path, 'bin')):
        print "buildout environment exists already"
        return
    upload_ssh_deploy_key()
    run('mkdir -p %(path)s' % env)
    if env.repo.startswith('git'):
        run('cd %(path)s; git clone -b %(branch)s %(repo)s .' % env)
        git.update()
    elif env.repo.startswith('ssh+svn'):
        run('cd %(path)s; svn co %(repo)s' % env)
    tool = django_exec().get("checkout_tool")
    if tool == "buildout":
        run('cd %(path)s; sh init.sh -c %(buildout_cfg)s' % env)
        django_utils.append_settings()
    elif tool == "virtualenv":
        import virtualenv
        virtualenv.create()
        django_utils.append_settings()
        django_utils.manage("syncdb --all --noinput")
        django_utils.manage("migrate --fake")
    else:
        print "WARNING: Couldnt find [checkout] tool - please set it to either virtualenv or buildout in your config.ini"
        print "Got tool: %s" % tool
        django_utils.append_settings()
    supervisor_update_config_file()
    nginx_update_config_file()
Ejemplo n.º 2
0
def init():
    # TODO: Use utils.config (after checkout)
    if files.exists(os.path.join(env.path, 'bin')):
        print "buildout environment exists already"
        return
    upload_ssh_deploy_key()
    run('mkdir -p %(path)s' % env)
    if env.repo.startswith('git'):
        run('cd %(path)s; git clone -b %(branch)s %(repo)s .' % env)
        git.update()
    elif env.repo.startswith('ssh+svn'):
        run('cd %(path)s; svn co %(repo)s' % env)
    tool = django_exec().get("checkout_tool")
    if tool == "buildout":
        run('cd %(path)s; sh init.sh -c %(buildout_cfg)s' % env)
        django_utils.append_settings()
    elif tool == "virtualenv":
        import virtualenv
        virtualenv.create()
        django_utils.append_settings()
        django_utils.manage("syncdb --all --noinput")
        django_utils.manage("migrate --fake")
    else:
        print "WARNING: Couldnt find [checkout] tool - please set it to either virtualenv or buildout in your config.ini"
        print "Got tool: %s" % tool
        django_utils.append_settings()
    supervisor_update_config_file()
    nginx_update_config_file()
Ejemplo n.º 3
0
def init():
    if files.exists(os.path.join(env.path, 'bin')):
        print "buildout environment exists already"
        return
    upload_ssh_deploy_key()
    run('mkdir -p %(path)s' % env)
    run('mkdir -p %(logdir)s' % env)
    run('mkdir -p %(path)s../tmp' % env)
    run('mkdir -p %(path)s../config' % env)
    if env.repo.startswith('git'):
        run('cd %(path)s; git clone -b %(branch)s %(repo)s .' % env)
        git.update()
    elif env.repo.startswith('ssh+svn'):
        run('cd %(path)s; svn co %(repo)s' % env)

    if config.sites['main']['redis']['enabled']:
        redis_update_config_file()

    if config.sites["main"]['supervisor']['use_global_supervisord'] == True:
        supervisor_update_config_file()
    else:
        supervisor_update_config_file(load_config=False)
        # This can fail if the supervisor daemon is already running.
        run(config.sites["main"]['supervisor']['supervisord_command'])
        supervisor_update_config_file(load_config=True)

    if config.sites["main"]['nginx']['enabled'] == True:
        nginx_update_config_file()

    tool = config.sites['main'].get('checkout', {}).get('tool')
    if tool == "buildout":
        run('cd %(path)s; sh init.sh -c %(buildout_cfg)s' % env)
        django_utils.append_settings()
    elif tool == "virtualenv":
        import virtualenv
        virtualenv.create()
        django_utils.append_settings()
        django_utils.manage("syncdb --all --noinput")
        django_utils.manage("migrate --fake")
    else:
        print "WARNING: Couldnt find [checkout] tool - please set it to either virtualenv or buildout in your config.ini"
        print "Got tool: %s" % tool
        django_utils.append_settings()
Ejemplo n.º 4
0
def init():
    if files.exists(os.path.join(env.path, 'bin')):
        print "buildout environment exists already"
        return
    upload_ssh_deploy_key()
    run('mkdir -p %(path)s' % env)
    run('mkdir -p %(logdir)s' % env)
    run('mkdir -p %(path)s../tmp' % env)
    run('mkdir -p %(path)s../config' % env)
    if env.repo.startswith('git'):
        run('cd %(path)s; git clone -b %(branch)s %(repo)s .' % env)
        git.update()
    elif env.repo.startswith('ssh+svn'):
        run('cd %(path)s; svn co %(repo)s' % env)

    if config.sites['main']['redis']['enabled']:
        redis_update_config_file()

    if config.sites["main"]['supervisor']['use_global_supervisord'] == True:
        supervisor_update_config_file()
    else:
        supervisor_update_config_file(load_config=False)
        run(config.sites["main"]['supervisor']['supervisord_command'])
        supervisor_update_config_file(load_config=True)

    if config.sites["main"]['nginx']['enabled'] == True:
        nginx_update_config_file()

    tool = config.sites['main'].get('checkout', {}).get('tool')
    if tool == "buildout":
        run('cd %(path)s; sh init.sh -c %(buildout_cfg)s' % env)
        django_utils.append_settings()
    elif tool == "virtualenv":
        import virtualenv
        virtualenv.create()
        django_utils.append_settings()
        django_utils.manage("syncdb --all --noinput")
        django_utils.manage("migrate --fake")
    else:
        print "WARNING: Couldnt find [checkout] tool - please set it to either virtualenv or buildout in your config.ini"
        print "Got tool: %s" % tool
        django_utils.append_settings()