major changes to layout
modified: modules/conf_setup.py modified: modules/docker.py modified: modules/initialize.py modified: modules/maintenance.py modified: share/templates/conf/django/files/settings.jinja2 modified: share/templates/conf/gunicorn/files/settings.jinja2 modified: share/templates/meta/development.yml modified: share/templates/meta/layout.yml
This commit is contained in:
parent
d42f118ad6
commit
e91f62b794
8 changed files with 12 additions and 84 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue