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 = {'gvencode': {'task': 'gvencode', 'loglevel': True, 'stdout': False, 'job': 'services'}, 'command': {'task': 'command', 'loglevel': True, 'stdout': False, 'job': 'services'}, 'leaf': {'task': 'leaf', 'loglevel': True, 'stdout': False, 'job': 'services'}, 'events': {'task': 'events', 'loglevel': True, 'stdout': False, 'job': 'services'}, 'nats': {'task': 'nats', 'loglevel': False, 'stdout': False, 'job': 'services'}, 'disco': {'task': 'disco', 'loglevel': True, 'stdout': False, 'job': 'services'}, 'root': {'task': 'root', 'loglevel': True, 'stdout': False, 'job': 'services'}, 'compose': {'task': 'compose', 'loglevel': True, 'stdout': False, 'job': 'services'}}

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, **kwargs)

Load a project file.

The function calls get_project_file() to fill in the first parameter for the project file.

Then it sets PROJECTDIR to the folder containing the project file.

Finally, it calls consul_template() to evaluate the file as a Consul template using any kwargs passed as argument.

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