[buildout]
extends =
# buildout.hash.cfg is used for automated hash calculation of managed
# instance files by calling update-hash
  buildout.hash.cfg
# "slapos" stack describes basic things needed for 99.9% of SlapOS Software
# Releases
  ../../stack/slapos.cfg
# Extend monitoring stack to provide necessary tools for monitoring
  ../../stack/monitor/buildout.cfg
# Extend here component profiles, like openssl, apache, mariadb, curl...
# Or/and extend a stack (lamp, tomcat) that does most of the work for you
# In this example we extend needed components for html5as.
  ../../component/nginx/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/tar/buildout.cfg
  ../../component/curl/buildout.cfg

parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
# in 99,9% of Slapos Software Releases)
    slapos-cookbook
# Call creation of instance.cfg file that will be called for deployment of
# instance
    template-cfg

# Download instance.cfg.in (buildout profile used to deployment of instance),
# replace all {{ foo_bar }} parameters by real values
# The recipe, template and mode are fetched from jijna-template
[template-cfg]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
mode = 0644
context =
  section buildout buildout
  key nginx_location nginx:location
  key dash_location dash:location
  key curl_location curl:location
  key tar_location tar:location
  key template_nginx_conf_target template_nginx_conf:target
  key template_mime_types_target template_mime_types:target
  key template_launcher_target template_launcher:target
  key template_instance_html5as_target instance_html5as:target
  key template_index_html_target template_index_html:target
  key template_graceful_target template_graceful:target
# Monitor stack also provides a template for the instance
  key template_monitor monitor2-template:rendered

# Have one shared section to define the default behaviour to download
# templates. Sections inheriting from this one won't need to redefine
# shared parameters
[download-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
mode = 0644

# Download instance_html5as.cfg.in
[instance_html5as]
# This section inherit from download-base
<= download-base
# Filename and md5sum is defined in buildout.hash.cfg

[template_nginx_conf]
<= download-base

[template_launcher]
<= download-base

[template_mime_types]
<= download-base

[template_index_html]
<= download-base

[template_graceful]
<= download-base

# Pin versions of eggs used that are not already pinned by stack/slapos.cfg
[versions]
slapos.recipe.template = 4.4
