#
#############################
#
-# In this file is explained how to add a new value that the software will handle
+# Now we are going how to add new parts, using new recipes
#
#############################
[buildout]
directory
publish-connection-parameter
+# Don't forget to include the new part ! It will also call the dependency [template-get] in software.cfg
+ template-creation
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
home = $${buildout:directory}
etc = $${:home}/etc
var = $${:home}/var
+# Creation of the folder wich will contain the jinja template
+data-folder = $${:home}/srv/data
# Executables put here will be started but not monitored (for startup scripts)
script = $${:etc}/run/
# Executables put here will be started and monitored (for daemons)
# Path of the log directory used by our service (see [hello-world])
log = $${:var}/log
+
+# It is now time for Jinja !
+[template-creation]
+recipe = slapos.recipe.template:jinja2
+# the value of template will be replaced thanks to the information given in software.cfg, during software building.
+# This is why there is only one $.
+# The $$ symbol is processed during the buildout of software.cfg and is then changed in an only $.
+template = ${template-get:location}/${template-get:filename}
+# It is also possible define the template inline.
+#template = inline:
+# ----------------------------------
+# Title : {{title}}
+# ----------------------------------
+# Hello {{name}}
+# Here we can declare where we want to get the new file rendered by Jinja
+rendered = $${directory:data-folder}/data1.txt
+mode = 700
+# In the context we can define the specific values wich will be substituted in the template
+# "key" means that the value is defined by buildout. Go to http://git.erp5.org/gitweb/slapos.recipe.template.git/blob/HEAD:/slapos/recipe/template/README.jinja2.txt?js=1 for more information
+context =
+ key name instance-parameter:configuration.name + key title instance-parameter:configuration.title
|