genvid.toolbox.ProjectTool

Warning

This module has been deprecated. Although the code is still working for our oldest model, it is not expected to work with the new Bastion API. Please use the new genvid-sdk tool.

class genvid.toolbox.ProjectTool(**kwargs)

Bases: genvid.toolbox.consul_template.ConsulTemplateTool

Tool for managing project files.

LOGS = {'root': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'root'}, 'leaf': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'leaf'}, 'events': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'events'}, 'command': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'command'}, 'disco': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'disco'}, 'gvencode': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'gvencode'}, 'compose': {'stdout': False, 'loglevel': True, 'job': 'services', 'task': 'compose'}}

The default list of logs.

get_project_file(dir_or_file)

Return a project file.

The argument can be either a directory or a project file. If it is a directory, the following files will be searched in this order inside the directory: genvid.hcl, genvid.json.

update_project(project, _islocal=None)

This method tries to update a project to the newer Genvid version.

The update runs after the template engines are run, so could lose some information.

load_project(dir_or_file: str, **kwargs)

Load a project file.

A project file is either a JSON or HCL file (called either genvid.json or genvid.hcl) which may or may not contain templating directives to be resolved using consul-template.

This method sets PROJECTDIR to the directory containing the project file as a side effect.

Parameters:
  • dir_or_file – The specified path is going to be recursively searched to locate a genvid.json or genvid.hcl project file.
  • kwargs – All additional keyword parameters are going to be passed directly to consul-template.

Note

The Consul server doesn’t need to run if your file doesn’t require anything from Consul. The result is parsed as either a JSON file if the extension is .json or an HCL file, otherwise.

class project.ProjectTool

Implementation of genvid.toolbox.ProjectTool