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

The default list of logs.

get_project_file(dir_or_file)

Return a project file

The argument could 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.

load_project(dir_or_file, **kwargs)

Load a project file.

The first parameter is looked up using get_project_file() for the project file.

The PROJECTDIR will then be set to the folder containing the projectfile.

Afterward, the file will be evaluated as a consul template using consul_template(), using any kwargs passed as argument. Note, if your file doesn’t required anything from consul, the consul server is not required to run. The result is then parsed as either a JSON file if the extension is .json, or an HCL file otherwise.

update_project(project, _islocal=None)

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

The upgrade is done after the template engine are run, and so could lose some information.

class project.ProjectTool

Implementation of genvid.toolbox.ProjectTool