Commit 2c23f625 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: Stop rendering software*.cfg

After previous patch this rendering became unneeded. And after we stop
render-templates becomes unneeded too, so say goodbye to it as well.
parent 36ebb6ec
......@@ -9,29 +9,6 @@ How to deploy from scratch
2. Install ors playbook
3. Deploy this SR
## Generated buildout configurations and json input schemas
Since there are multiple ors-amarisoft softwares releases and software types, the following files are
generated with jinja2 templates with the render-templates script before being pushed to gitlab:
* instance-tdd-enb-input-schema.json
* instance-fdd-enb-input-schema.json
* software-fdd.cfg
* software-tdd.cfg.json
* instance-fdd-ue-nr-input-schema.json
* instance-tdd-gnb-input-schema.json
* instance-tdd-ue-nr-input-schema.json
* test/testFDD.py
* test/testTDD.py
* software-tdd.cfg
* instance-tdd-ue-lte-input-schema.json
* instance-fdd-gnb-input-schema.json
* software-fdd.cfg.json
* instance-fdd-ue-lte-input-schema.json
These files should not be modified directly, and the render-templates scripts should be run along
with update-hash before each commit.
## Services
We run 2 binaries from Amarisoft LTE stack:
......
#!/usr/bin/env python3
from jinja2 import Template
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--delete', action='store_true')
args = parser.parse_args()
global_context = {
'generated_file_message': "This file was generated using a jinja2 template and the render-templates script, don't modify directly."
}
ors = {
'software_name' : 'ors',
'bbu' : 'ors',
}
generic = {
'software_name' : 'generic',
'bbu' : 'server',
}
with open('software.jinja2.cfg', 'r') as f:
software_template = Template(f.read())
# emit updates file @ path with data on regular run and deletes it on --delete.
def emit(path, data):
data += '\n'
if args.delete:
os.remove(path)
else:
with open(path, 'w+') as f:
f.write(data)
for software in (ors, generic):
ctx = software | global_context
if software is generic:
v = ''
else:
v = '-'+software['software_name']
emit('software{}.cfg'.format(v),
software_template.render(**ctx))
# This file was generated using a jinja2 template and the render-templates script, don't modify directly.
[buildout]
extends =
software-ors-base.cfg
# This file was generated using a jinja2 template and the render-templates script, don't modify directly.
[buildout]
extends =
software-base.cfg
# {{ generated_file_message }}
[buildout]
extends =
{%- if bbu == 'ors' %}
software-ors-base.cfg
{%- else %}
software-base.cfg
{%- endif %}
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