Commit 19cf1959 authored by Samuel GAIST's avatar Samuel GAIST

[backend][tests][common] Made beat.example location configurable

This allows to use beat.example from outside of beat.web location.
parent cf6b5dd6
......@@ -128,14 +128,21 @@ class BackendUtilitiesMixin(object):
environment = dict(name=env.name, version=env.version),
)
example_root = os.environ.get("BEAT_EXAMPLE_ROOT", None)
if example_root is None:
example_root = os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))
prefix = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0]))),
example_root,
'src',
'beat.examples',
)
install.install_contributions(prefix, 'system', template_data)
install.install_contributions(prefix, 'test', template_data)
if not os.path.exists(prefix):
raise RuntimeError("beat.examples path does not exists")
for project in ['system', 'test']:
install.install_contributions(prefix, project, template_data)
if not os.path.exists(settings.CACHE_ROOT):
os.mkdir(settings.CACHE_ROOT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment