Commit fadfc92e authored by Ayush Tiwari's avatar Ayush Tiwari

Hello World: repetition_number parameter added

parent 9bd111f4
......@@ -44,6 +44,7 @@ configuration.name = John Doe
# If the user doesn't specify it, it won't break and the recipe can handle it (i.e don't send any mail for example).
# Add parameter title to be provided by user/developer, would be None in case user fails to give anything
configuration.title =
configuration.repetition_number =
# Create all needed directories, depending on your needs
[directory]
......@@ -104,10 +105,11 @@ recipe = slapos.recipe.template:jinja2
template = ${template-download:location}/${template-download:filename}
rendered = $${directory:data-fold}/data1.txt
#Why 700 specifically for rendered text file ??
mode = 700
#mode = 640
context =
key name instance-parameter:configuration.name
key title instance-parameter:configuration.title
key repetition_number instance-parameter:configuration.repetition_number
# Publish all the parameters needed for the user to connect to the instance.
# It can be anything: URL(s), password(s), or arbitrary parameters.
......@@ -117,5 +119,6 @@ recipe = slapos.cookbook:publish
name = Hello $${instance-parameter:configuration.name
# Publishing the title from configuration
title = $${instance-parameter:configuration.title}
repetition_number = $${instance-parameter:configuration.repetition_number}
url = $${hello-world:url}
path = $${render-template:rendered}
......@@ -42,6 +42,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = rendered.in
download-only = True
mode = 0644
md5sum = 00686c63d981b0bdcfd22e9153f2590c
# install hello-web with correct python_executable
[hello-web-bin]
......
......@@ -4,4 +4,8 @@
{% endif -%}
{% set max_count = repetition_number|int -%}
{% for num in range(max_count) -%}
Hello {{ name }}
{% endfor -%}
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