diff --git a/modules/conf_setup.py b/modules/conf_setup.py index d8f033d..d402443 100644 --- a/modules/conf_setup.py +++ b/modules/conf_setup.py @@ -87,7 +87,7 @@ def _backup_readmes(): dest_readmes = configuration.tools.fabric.templates.readmes source_readmes = os.path.join( - configuration.paths.project.root, 'scripts', 'readmes') + configuration.paths.project.root, 'share', 'readmes') copy_directories(source_readmes, dest_readmes) @@ -170,7 +170,7 @@ def _modify_configuration(branch): config_yaml['nginx']['port'] = 'NGINX_PORT' - if hasattr(config_yaml['virtualenv'], 'name'): + if 'name' in config_yaml['virtualenv']: config_yaml['virtualenv']['name'] = 'PROJECT_NAME' return config_yaml @@ -209,7 +209,7 @@ def deploy_readmes(): dest_readmes = os.path.join( configuration.paths.project.root, - 'scripts', 'readmes') + 'share', 'readmes') copy_directories(source_readmes, dest_readmes) diff --git a/modules/docker.py b/modules/docker.py index d7a41b9..77a672d 100644 --- a/modules/docker.py +++ b/modules/docker.py @@ -176,6 +176,7 @@ def start(create=False): @task def stop(remove=False): """ + remove=False this will start the docker container referenced by container_type NOTE: you should have created it with the docker.create method above diff --git a/modules/initialize.py b/modules/initialize.py index c7fefb5..a332b51 100644 --- a/modules/initialize.py +++ b/modules/initialize.py @@ -433,8 +433,6 @@ def get_config(branchname): _init_docker(dataobject, layout, config) - _init_overrides(dataobject, layout, config) - # # maintenance commands @@ -899,75 +897,6 @@ def _init_docker(configuration, layout, config): config['docker']['database']['env']['name'] -def _init_overrides(configuration, layout, config): - - # - # overrides - this is where we specify what unusual overrides we need to do - - # NOTE: - # the purpose of the override code is to allow us to contain project - # specific information outside of the "scripts" directory. One of the - # biggest challenges with setting up multiple projects using the current - # fabric scripts is making the fabric scripts project-independent - # - # I am hoping that by abstracting the override code from the rest of the - # fabric scripts I can achieve that goal - - configuration.addbranch("overrides") - - configuration.paths.addbranch("overrides") - - configuration.paths.overrides.addbranch("templates") - - configuration.paths.overrides.templates.root = os.path.join( - configuration.paths.project.root, - layout["paths"]["extras"]["templates"]) - - configuration.paths.overrides.modules = os.path.join( - configuration.paths.project.root, - layout["paths"]["extras"]["modules"]) - - # print configuration.paths.overrides.modules - - configuration.overrides.addbranch("modules") - - configuration.paths.overrides.templates.files = os.path.join( - configuration.paths.overrides.templates.root, - "files") - - configuration.paths.overrides.templates.build = os.path.join( - configuration.paths.overrides.templates.root, - "build") - - # NOTE: - # this is the code where we append the override path to the current sys - # path. After we do that, we load up the initialization code that is - # specific to this project (if any). - - # check to see if overrides is in the configuration - # if not, just return - - import sys - sys.path.append(configuration.paths.overrides.modules) - import override - override.initialize(configuration, config, layout, env) - - # import utils - # location = "initialize._init_override" - - # utils.print_console("beg debug %s" % location) - # print "paths.project.root : %s" \ - # % configuration.paths.project.root - - # print "paths.overrides.templates.root : %s" \ - # % configuration.paths.overrides.templates.root - - # print "paths.overrides.modules : %s" \ - # % configuration.paths.overrides.modules - - # utils.print_console("end debug %s" % location) - - @task def create_local(branch=None): diff --git a/modules/maintenance.py b/modules/maintenance.py index e0db990..1ce1506 100644 --- a/modules/maintenance.py +++ b/modules/maintenance.py @@ -156,7 +156,7 @@ def _get_configuration_path(name, branch): "value such from %s" % (name, param_list) META_DIR = os.path.join( - get_project_root(), 'scripts', 'meta', 'configuration') + get_project_root(), 'usr', 'meta', 'configuration') if name == "config": diff --git a/share/templates/conf/django/files/settings.jinja2 b/share/templates/conf/django/files/settings.jinja2 index 02c186c..be1fd74 100644 --- a/share/templates/conf/django/files/settings.jinja2 +++ b/share/templates/conf/django/files/settings.jinja2 @@ -25,7 +25,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(BASE_DIR, os.pardir)) # infomration for the settings file sys.path.insert(0, os.path.join( - PROJECT_ROOT, 'scripts', 'tools', 'fabric', 'modules')) + PROJECT_ROOT, 'usr', 'bin', 'fabric', 'modules')) # # add an "apps" directory to this project, which is where all the apps diff --git a/share/templates/conf/gunicorn/files/settings.jinja2 b/share/templates/conf/gunicorn/files/settings.jinja2 index 02c186c..be1fd74 100644 --- a/share/templates/conf/gunicorn/files/settings.jinja2 +++ b/share/templates/conf/gunicorn/files/settings.jinja2 @@ -25,7 +25,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(BASE_DIR, os.pardir)) # infomration for the settings file sys.path.insert(0, os.path.join( - PROJECT_ROOT, 'scripts', 'tools', 'fabric', 'modules')) + PROJECT_ROOT, 'usr', 'bin', 'fabric', 'modules')) # # add an "apps" directory to this project, which is where all the apps diff --git a/share/templates/meta/development.yml b/share/templates/meta/development.yml index 2767f8d..2eb3962 100644 --- a/share/templates/meta/development.yml +++ b/share/templates/meta/development.yml @@ -45,4 +45,4 @@ project: rootpath: /usr/local/var/www supervisor: paths: {conf: /usr/local/etc/supervisor/conf.d} -virtualenv: {name: debates_eu, workon: /Users/ronny/.virtualenvs} +virtualenv: {name: PROJECT_NAME, workon: /Users/ronny/.virtualenvs} diff --git a/share/templates/meta/layout.yml b/share/templates/meta/layout.yml index 2822d37..a623210 100644 --- a/share/templates/meta/layout.yml +++ b/share/templates/meta/layout.yml @@ -12,7 +12,7 @@ paths: tools: fabric: - root: "scripts/tools/fabric" + root: "usr/bin/fabric" templates: conf: "share/templates/conf" meta: "share/templates/meta" @@ -26,16 +26,14 @@ paths: extras: code: "extras/scripts/code" - modules: "extras/scripts/code/modules" - templates: "extras/scripts/templates" fixtures: "extras/data/fixtures" templates: - conf: "scripts/conf" + conf: "usr/etc" logging: django: - project: "extras/log" + project: "var/log" server: "django" logging: @@ -50,7 +48,7 @@ modules: override: "override" virtualenv: - requirements: "scripts/meta/virtualenv" + requirements: "usr/meta/virtualenv" # directories containing templates templates: