Commit 46f6dc08 authored by Nicolas Wavrant's avatar Nicolas Wavrant

helloworld : new parameter (title) added

parent 4c82d777
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
# Deploy hello-world instance # Deploy hello-world instance
# #
############################# #############################
#
# In this file is explained how to add a new value that the software will handle
#
#############################
[buildout] [buildout]
parts = parts =
directory directory
...@@ -37,6 +41,9 @@ cert = $${slap_connection:cert_file} ...@@ -37,6 +41,9 @@ cert = $${slap_connection:cert_file}
# All possible parameters should have a default. # All possible parameters should have a default.
# In our use case, we are expecting from the user to specify one (optional) parameter: "name". We put the default value here if he doesn't specify it, so that it doesn't crash. # In our use case, we are expecting from the user to specify one (optional) parameter: "name". We put the default value here if he doesn't specify it, so that it doesn't crash.
configuration.name = John Doe configuration.name = John Doe
# Here is the declaration of the default value for the parameter title (actually, it is void). If commented, the recipe will crash.
# The first part of the name paramater ("configuration.") means that the value can be manually defined thanks to the parameters of the instance
configuration.title =
# If our use case requires that the user can specify a mail address so that his instance can mail to him (for example), we can do: # If our use case requires that the user can specify a mail address so that his instance can mail to him (for example), we can do:
# configuration.mail-address = # configuration.mail-address =
# 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).
...@@ -79,3 +86,5 @@ wrapper-path = $${directory:service}/hello-world ...@@ -79,3 +86,5 @@ wrapper-path = $${directory:service}/hello-world
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
name = Hello $${instance-parameter:configuration.name}! name = Hello $${instance-parameter:configuration.name}!
# Adds the published parameter "title". By default, its value is "Title : " + the value declared in the section [instance-parameter] above.
title = Title : $${instance-parameter:configuration.title}
...@@ -25,6 +25,8 @@ parts = ...@@ -25,6 +25,8 @@ parts =
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg output = ${buildout:directory}/instance.cfg
# MD5 checksum can be skipped for development (easier to develop), but must be filled for production # MD5 checksum can be skipped for development (easier to develop).
md5sum = ed94ac99ae1e596c0da5350da6ab6f52 # While developping, comment this line to avoid a crash while deploying the software.
# For production, you must give the md5 hash of instance.cfg.in
#md5sum = ab51bfb473e030514997c7691951601f
mode = 0644 mode = 0644
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