add edit for meta configuration files

This commit is contained in:
Ronny Abraham 2019-06-02 22:31:41 +03:00
parent 0e69a5d65a
commit 926a126fb8

View file

@ -737,3 +737,51 @@ def ssh():
logger.debug("ssh command: %s" % cmd_ssh)
else:
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