Commit 11ad0309 authored by donkey-hotei's avatar donkey-hotei

add hello-world shell script and 'title' instance param

parent ae2bbf31
...@@ -36,6 +36,7 @@ cert = ${slap_connection:cert_file} ...@@ -36,6 +36,7 @@ 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
configuration.title = Galaxy
# 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).
...@@ -85,6 +86,16 @@ command-line = ...@@ -85,6 +86,16 @@ command-line =
# exits/crashes, it will trigger a "bang" and cause a re-run of the instance. # exits/crashes, it will trigger a "bang" and cause a re-run of the instance.
wrapper-path = ${directory:service}/helloweb-${:kind} wrapper-path = ${directory:service}/helloweb-${:kind}
# Create a simple shell script that will output whatever string specified as an instance param.
[hello-world]
# Recipe will try to "exec" the command line after separating parameters
recipe = slapos.cookbook:wrapper
# notice there is only one $ at ${dash:location}, because comes from the SR buildout profile
command-line = ${dash:location}/bin/bash -c 'echo "Welcome to the $${instance-parameter:configuration.title}" < $${directory:log}/log.log; sleep 10000000;'
# place shell script in /etc/service directory. each executable in this repo will be started
# and monitored by supervisord. if program crashes it will trigger a "bang" & case run of slapgrid
# for the instance
wrapper-path = $${directory:service}/hello-world
# promise, that checks that helloweb service is alive # promise, that checks that helloweb service is alive
[helloweb-promise] [helloweb-promise]
...@@ -128,6 +139,7 @@ parts += ...@@ -128,6 +139,7 @@ parts +=
[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}!
title = $${instance-parameter:configuration.title}
{%- for kind in service_list %} {%- for kind in service_list %}
url.{{ kind }} = ${helloweb-{{ kind }}:url} url.{{ kind }} = ${helloweb-{{ kind }}:url}
{%- endfor %} {%- endfor %}
...@@ -10,6 +10,7 @@ extends = ...@@ -10,6 +10,7 @@ extends =
# ../../component/component1/buildout.cfg # ../../component/component1/buildout.cfg
# ../../component/component2/buildout.cfg # ../../component/component2/buildout.cfg
../../component/helloweb/buildout.cfg ../../component/helloweb/buildout.cfg
../../component/dash/buildout.cfg
parts = parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed # Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
......
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