[buildout]

extends = {{ monitor_template_output }}

parts =
 config-drb  
 config-enb  
 config-epc  
 config-mbms  
 config-rr  
 config-sib  
 config-ue  
 config-user_db
 srsepc
 srsenb
 monitor-base
 publish-connection-information

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

[directory]
srsconfig = $${buildout:directory}/.srs

[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
  section directory directory

[config-drb] 
<= config-base
template = {{ config_drb_template }}
rendered = $${directory:srsconfig}/drb.conf

[config-enb] 
<= config-base
template = {{ config_enb_template }}
rendered = $${directory:srsconfig}/enb.conf

[config-epc]
<= config-base
template = {{ config_epc_template }}
rendered = $${directory:srsconfig}/epc.conf

[config-mbms]  
<= config-base
template = {{ config_mbms_template }}
rendered = $${directory:srsconfig}/mbms.conf

[config-rr]
<= config-base
template = {{ config_rr_template }}
rendered = $${directory:srsconfig}/rr.conf

[config-sib]  
<= config-base
template = {{ config_sib_template }}
rendered = $${directory:srsconfig}/sib.conf

[config-ue]
<= config-base
template = {{ config_ue_template }}
rendered = $${directory:srsconfig}/ue.conf

[config-user_db]
<= config-base
template = {{ config_user_db_template }}
rendered = $${directory:srsconfig}/user_db.csv

[srsepc]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
pidfile = $${directory:run}/srsepc.pid
command-line =
  /usr/bin/sudo {{ srsepc_bin }} 

[srsenb]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
pidfile = $${directory:run}/srsenb.pid
command-line =
  /usr/bin/sudo {{ srsenb_bin }} 

[publish-connection-information]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=$${monitor-publish-parameters:monitor-url}&username=$${monitor-publish-parameters:monitor-user}&password=$${monitor-publish-parameters:monitor-password}
