Ejemplo n.º 1
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        raise Exception("Unrecognized Deploy Level: %s" % deploy_level)

#    env.user = settings.PROJECT_USER
#    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
    env.project = settings.PROJECT_NAME
    env.project_root = settings.PROJECT_ROOT % env #remember to pass in the 'env' dict before using this field from settings, since it could contain keywords.
    env.sudo_user = settings.SUDO_USER
    _setup_path()
    env.db_user = settings.DB_DATABASE_USER
    env.db_name = settings.DB_DATABASE_NAME

    if env.os == 'ubuntu':
        env.pg_conf_dir = '/etc/postgresql/8.4/main'
        env.pg_init_name = 'postgresql-8.4'
        env.pg_data_dir = '/var/lib/postgresql/8.4/main'
    elif env.os == 'redhat':
        env.pg_conf_dir = '/var/lib/pgsql/data'
        env.pg_init_name = 'postgresql'
        env.pg_data_dir = '/var/lib/pgsql/data'

    env.new_db_location = posixpath.join(settings.DB_ALTERNATE_LOCATION,'pgsql')
    env.move_db_now = settings.DB_MOVE_DB_AT_BOOTSTRAP
Ejemplo n.º 2
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        raise Exception("Unrecognized Deploy Level: %s" % deploy_level)


#    env.user = settings.PROJECT_USER
#    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
    env.project = settings.PROJECT_NAME
    env.project_root = settings.PROJECT_ROOT % env  #remember to pass in the 'env' dict before using this field from settings, since it could contain keywords.
    env.sudo_user = settings.SUDO_USER
    _setup_path()
    env.db_user = settings.DB_DATABASE_USER
    env.db_name = settings.DB_DATABASE_NAME

    if env.os == 'ubuntu':
        env.pg_conf_dir = '/etc/postgresql/8.4/main'
        env.pg_init_name = 'postgresql-8.4'
        env.pg_data_dir = '/var/lib/postgresql/8.4/main'
    elif env.os == 'redhat':
        env.pg_conf_dir = '/var/lib/pgsql/data'
        env.pg_init_name = 'postgresql'
        env.pg_data_dir = '/var/lib/pgsql/data'

    env.new_db_location = posixpath.join(settings.DB_ALTERNATE_LOCATION,
                                         'pgsql')
    env.move_db_now = settings.DB_MOVE_DB_AT_BOOTSTRAP
Ejemplo n.º 3
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        utils.abort("Unrecognized Deploy Level: %s" % deploy_level)
    env.pip_requirements_local_path = settings.PACKAGES_PIP_REQUIREMENTS_PATH  #this is the local machine requires file path
    env.project_user = settings.PROJECT_USER
    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
Ejemplo n.º 4
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        utils.abort("Unrecognized Deploy Level: %s" % deploy_level)
    env.pip_requirements_local_path = settings.PACKAGES_PIP_REQUIREMENTS_PATH  #this is the local machine requires file path
    env.project_user = settings.PROJECT_USER
    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
Ejemplo n.º 5
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        raise Exception("Unrecognized Deploy Level: %s" % deploy_level)

    env.user = settings.PROJECT_USER
    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
    env.project = settings.PROJECT_NAME
    env.project_root = settings.PROJECT_ROOT % env  #remember to pass in the 'env' dict before using this field from settings, since it could contain keywords.
    env.sudo_user = settings.SUDO_USER
    _setup_path()
Ejemplo n.º 6
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        raise Exception("Unrecognized Deploy Level: %s" % deploy_level)

    env.user = settings.PROJECT_USER
    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
    env.project = settings.PROJECT_NAME
    env.project_root = settings.PROJECT_ROOT % env #remember to pass in the 'env' dict before using this field from settings, since it could contain keywords.
    env.sudo_user = settings.SUDO_USER
    _setup_path()
Ejemplo n.º 7
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        utils.abort("Unrecognized Deploy Level: %s" % deploy_level)
    env.os = what_os()
    if env.os == 'ubuntu':
        env.package_list = settings.OS_PACKAGE_LIST_PATH_UBUNTU
        env.package_install_cmd = 'apt_get install -y'
    elif env.os == 'redhat':
        env.package_install_cmd = 'yum install -y'
        env.package_list = settings.OS_PACKAGE_LIST_PATH_REDHAT
    else:
        utils.abort('Unrecognized OS: %s. Aborting.' % env.os)
    env.project = settings.PROJECT_NAME
Ejemplo n.º 8
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        utils.abort("Unrecognized Deploy Level: %s" % deploy_level)
    env.os = what_os()
    if env.os == 'ubuntu':
        env.package_list = settings.OS_PACKAGE_LIST_PATH_UBUNTU
        env.package_install_cmd = 'apt_get install -y'
    elif env.os == 'redhat':
        env.package_install_cmd = 'yum install'
        env.package_list = settings.OS_PACKAGE_LIST_PATH_REDHAT
    else:
        utils.abort('Unrecognized OS: %s. Aborting.' % env.os)
    env.project = settings.DJANGO_PROJECT_NAME
Ejemplo n.º 9
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        raise Exception("Unrecognized Deploy Level: %s" % deploy_level)

    #    env.user = settings.PROJECT_USER
    #    env.sudo_user = settings.SUDO_USER
    env.os = what_os()
    env.supervisor_init_path = settings.SUPERVISOR_INIT_TEMPLATE
    env.project = settings.PROJECT_NAME
    env.project_root = (
        settings.PROJECT_ROOT % env
    )  # remember to pass in the 'env' dict before using this field from settings, since it could contain keywords.
    env.sudo_user = settings.SUDO_USER
    _setup_path()
    _populate_supervisor_dict()
Ejemplo n.º 10
0
def setup_env(deploy_level="staging"):
    if deploy_level == "staging":
        _staging()
    elif deploy_level == "production":
        _production()
    else:
        raise Exception("Unrecognized Deploy Level: %s" % deploy_level)
    env.os = what_os()
#    env.user = settings.PROJECT_USER
#    env.sudo_user = settings.SUDO_USER
    env.project = settings.PROJECT_NAME
    env.project_root = settings.PROJECT_ROOT % env #remember to pass in the 'env' dict before using this field from settings, since it could contain keywords.
    env.httpd = settings.WEB_HTTPD
    env.httpd_local_template_path = settings.WEB_CONFIG_TEMPLATE_PATH
    httpd_dict = settings.WEB_PARAM_DICT
    _setup_path()

    #insert some additional useful pairs
    httpd_dict["code_root"] = env.code_root
    httpd_dict["log_dir"] = env.log_dir
    httpd_dict["project"] = env.project
    httpd_dict["virtualenv_root"] = env.virtualenv_root
    env.httpd_dict = httpd_dict