Esempio n. 1
0
import os
from os.path import abspath, dirname

# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))

# Absolute filesystem path to the top-level project folder:
SITE_ROOT = dirname(DJANGO_ROOT)

from _set_local_env_vars import import_env_vars

import_env_vars(SITE_ROOT)

ENVIRONMENT = os.getenv("PRJ_ENV")

if not ENVIRONMENT:
    ENVIRONMENT = 'dev'

if ENVIRONMENT == 'production':
    from .production import *
elif ENVIRONMENT == 'dev':
    from .dev import *
elif ENVIRONMENT == 'staging':
    from .staging import *
elif ENVIRONMENT == 'test':
    from .test import *
Esempio n. 2
0
import os
from os.path import abspath, dirname

# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))

# Absolute filesystem path to the top-level project folder:
SITE_ROOT = dirname(DJANGO_ROOT)

from _set_local_env_vars import import_env_vars
import_env_vars(SITE_ROOT)

ENVIRONMENT = os.getenv("PRJ_ENV")

if not ENVIRONMENT:
    ENVIRONMENT = 'dev'

if ENVIRONMENT == 'production':
    from .production import *
elif ENVIRONMENT == 'dev':
    from .dev import *
elif ENVIRONMENT == 'staging':
    from .staging import *
elif ENVIRONMENT == 'test':
    from .test import *
Esempio n. 3
0
import os, time, random, getpass
from os.path import abspath, dirname, isfile

from fabric.api import *
from fabric.contrib.files import append, exists

PROJECT_ROOT = dirname(abspath(__file__))

from _set_local_env_vars import import_env_vars
import_env_vars(PROJECT_ROOT)

PRJ_ENV = os.environ['PRJ_ENV']
PRJ_NAME = '%%PRJ_NAME%%'

PRJ_GIT_REPO = os.getenv('PRJ_GIT_REPO')

ENVIRONMENTS = {
    'dev': ['127.0.0.1'],
    'staging': '',
    'production': '',
    'test': '',
}

env.user = '******'
# to enable ssh key forwarding
env.forward_agent = True

@task
def dev():
    env.name = 'dev'
    env.hosts = ENVIRONMENTS[env.name]