add edit for meta configuration files
This commit is contained in:
parent
0e69a5d65a
commit
926a126fb8
1 changed files with 48 additions and 0 deletions
|
|
@ -737,3 +737,51 @@ def ssh():
|
||||||
logger.debug("ssh command: %s" % cmd_ssh)
|
logger.debug("ssh command: %s" % cmd_ssh)
|
||||||
else:
|
else:
|
||||||
local(cmd_ssh)
|
local(cmd_ssh)
|
||||||
|
|
||||||
|
|
||||||
|
@task
|
||||||
|
def edit(param='help', branch=None):
|
||||||
|
"""
|
||||||
|
calls up mvim on the configuration files for the branch
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .maintenance import edit as maintenance_edit
|
||||||
|
from .maintenance import _get_configuration_path
|
||||||
|
|
||||||
|
configuration = env.config
|
||||||
|
|
||||||
|
if not branch:
|
||||||
|
project_branch = configuration.project.branch
|
||||||
|
else:
|
||||||
|
project_branch = branch
|
||||||
|
|
||||||
|
config_path = _get_configuration_path('config', project_branch)
|
||||||
|
|
||||||
|
# locations = ['gunicorn', 'gunicorn_link', 'gunicorn_build',
|
||||||
|
# 'settings', 'local']
|
||||||
|
locations = {
|
||||||
|
'configuration': {
|
||||||
|
'path': config_path,
|
||||||
|
'desc': 'meta configuration file',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if param in locations.keys():
|
||||||
|
remote_path = locations[param]['path']
|
||||||
|
maintenance_edit(remote_path=remote_path)
|
||||||
|
else:
|
||||||
|
# if param == 'help':
|
||||||
|
|
||||||
|
print("""
|
||||||
|
"fab deploy.edit" automates editing branch configuration files
|
||||||
|
|
||||||
|
to use this you must pass one of the editable locations in as a
|
||||||
|
parameter
|
||||||
|
|
||||||
|
currently editable locations are:
|
||||||
|
""")
|
||||||
|
|
||||||
|
for k_loc in locations.keys():
|
||||||
|
print("\t{0: <20} - {1}".format(k_loc, locations[k_loc]['desc']))
|
||||||
|
|
||||||
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue