Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
slapos
Commits
fadfc92e
Commit
fadfc92e
authored
Sep 13, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hello World: repetition_number parameter added
parent
9bd111f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
software/helloworld/instance.cfg.in
software/helloworld/instance.cfg.in
+4
-1
software/helloworld/software.cfg
software/helloworld/software.cfg
+1
-0
software/helloworld/template/rendered.in
software/helloworld/template/rendered.in
+4
-0
No files found.
software/helloworld/instance.cfg.in
View file @
fadfc92e
...
...
@@ -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 = 70
0
#mode = 64
0
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}
software/helloworld/software.cfg
View file @
fadfc92e
...
...
@@ -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]
...
...
software/helloworld/template/rendered.in
View file @
fadfc92e
...
...
@@ -4,4 +4,8 @@
{% endif -%}
{% set max_count = repetition_number|int -%}
{% for num in range(max_count) -%}
Hello {{ name }}
{% endfor -%}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment