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