Commit 611c6f65 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Use new template options

Replace deprecated `slapos.recipe.template:jinja2` options:
- `rendered = <path>`     -> `output = <path>`
- `template = <path>`     -> `url = <path>`
- `template = inline:...` -> `inline = ...`

Favor `slapos.recipe.template` over `slapos.recipe.template:jinja2`
now that they both have `inline` option.
parent abe9e35c
...@@ -46,19 +46,17 @@ post-install = ...@@ -46,19 +46,17 @@ post-install =
keytar.node keytar.node
[theia-wrapper] [theia-wrapper]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
rendered = ${buildout:bin-directory}/${:_buildout_section_name_} output = ${buildout:bin-directory}/${:_buildout_section_name_}
template = inline =
inline:
#!/bin/sh #!/bin/sh
cd ${theia:location} cd ${theia:location}
exec ${yarn:location}/bin/yarn theia start "$@" exec ${yarn:location}/bin/yarn theia start "$@"
[theia-open] [theia-open]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
rendered = ${buildout:bin-directory}/${:_buildout_section_name_} output = ${buildout:bin-directory}/${:_buildout_section_name_}
template = inline =
inline:
#!/bin/sh #!/bin/sh
exec ${nodejs:location}/bin/node ${theia:location}/node_modules/.bin/theia-open "$@" exec ${nodejs:location}/bin/node ${theia:location}/node_modules/.bin/theia-open "$@"
......
...@@ -15,19 +15,19 @@ ...@@ -15,19 +15,19 @@
[instance-theia] [instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in _update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 4df9f0d76a134a8abec9060a0c1be50b md5sum = 898ada9e42d8aafae571eba230708cc3
[instance] [instance]
_update_hash_filename_ = instance.cfg.in _update_hash_filename_ = instance.cfg.in
md5sum = f2f01a47d98a980177dc1755e618bbb7 md5sum = 313eb380fdd2d0882f329af4a1157259
[instance-import] [instance-import]
_update_hash_filename_ = instance-import.cfg.jinja.in _update_hash_filename_ = instance-import.cfg.jinja.in
md5sum = 74b9b46769a25add50f9f63365de58ad md5sum = 29bc1c5b76d20fd46430dff5c72d192b
[instance-export] [instance-export]
_update_hash_filename_ = instance-export.cfg.jinja.in _update_hash_filename_ = instance-export.cfg.jinja.in
md5sum = b3f1dd83033d6a45def0bd26e70d5a9c md5sum = e2630148998c3cdf6d03b5e884d7f464
[instance-resilient] [instance-resilient]
_update_hash_filename_ = instance-resilient.cfg.jinja _update_hash_filename_ = instance-resilient.cfg.jinja
......
...@@ -24,12 +24,11 @@ namebase = {{ parameter_dict['namebase'] }} ...@@ -24,12 +24,11 @@ namebase = {{ parameter_dict['namebase'] }}
# to be pulled from the export instance. # to be pulled from the export instance.
# All it expects is that a script be available in exporter:wrapper. # All it expects is that a script be available in exporter:wrapper.
[exporter] [exporter]
wrapper = $${theia-export-script:rendered} wrapper = $${theia-export-script:output}
[theia-export-script] [theia-export-script]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/theia-export-script output = $${directory:bin}/theia-export-script
mode = 0700
exitcode-file = $${directory:srv}/export-exitcode-file exitcode-file = $${directory:srv}/export-exitcode-file
error-file = $${directory:srv}/export-errormessage-file error-file = $${directory:srv}/export-errormessage-file
context = context =
...@@ -46,8 +45,8 @@ context = ...@@ -46,8 +45,8 @@ context =
key exitfile :exitcode-file key exitfile :exitcode-file
key errorfile :error-file key errorfile :error-file
{%- raw %} {%- raw %}
template = inline =
inline:#!{{ bash }} #!{{ bash }}
{{ python }} {{ theia_export }} \ {{ python }} {{ theia_export }} \
--rsync {{ rsync }} \ --rsync {{ rsync }} \
--sqlite3 {{ sqlite3 }} \ --sqlite3 {{ sqlite3 }} \
...@@ -71,24 +70,24 @@ export-promises = ...@@ -71,24 +70,24 @@ export-promises =
<= monitor-promise-base <= monitor-promise-base
promise = check_command_execute promise = check_command_execute
name = resiliency-export-promise.py name = resiliency-export-promise.py
config-command = $${export-promise-script:rendered} config-command = $${export-promise-script:output}
[initial-export-exitcode-file] [initial-export-exitcode-file]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${theia-export-script:exitcode-file} output = $${theia-export-script:exitcode-file}
template = inline:0 inline = 0
once = $${:rendered} once = $${:output}
[export-promise-script] [export-promise-script]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/export-promise-script output = $${directory:bin}/export-promise-script
exitcode-file = $${initial-export-exitcode-file:rendered} exitcode-file = $${initial-export-exitcode-file:output}
context = context =
key exitcodefile :exitcode-file key exitcodefile :exitcode-file
key errorfile theia-export-script:error-file key errorfile theia-export-script:error-file
{%- raw %} {%- raw %}
template = inline =
inline:#!/bin/sh #!/bin/sh
if [ -z $(find {{ repr(exitcodefile) }} -mtime -2) ] if [ -z $(find {{ repr(exitcodefile) }} -mtime -2) ]
then then
echo "ERROR export script last ran on " $(date -r {{ repr(exitcodefile) }}) echo "ERROR export script last ran on " $(date -r {{ repr(exitcodefile) }})
......
...@@ -74,12 +74,11 @@ install = ...@@ -74,12 +74,11 @@ install =
os.symlink("/bin/true", location) os.symlink("/bin/true", location)
[importer] [importer]
wrapper = $${theia-import-script:rendered} wrapper = $${theia-import-script:output}
[theia-import-script] [theia-import-script]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/theia-import-script output = $${directory:bin}/theia-import-script
mode = 0700
exitcode-file = $${directory:srv}/import-exitcode-file exitcode-file = $${directory:srv}/import-exitcode-file
error-file = $${directory:srv}/import-errormessage-file error-file = $${directory:srv}/import-errormessage-file
context = context =
...@@ -101,10 +100,10 @@ context = ...@@ -101,10 +100,10 @@ context =
key exitfile :exitcode-file key exitfile :exitcode-file
key errorfile :error-file key errorfile :error-file
{%- raw %} {%- raw %}
template = inline =
inline:#!{{ bash }} #!{{ bash }}
. $${common-environment:rendered} . $${common-environment:output}
. $${slapos-standalone-activate:rendered} . $${slapos-standalone-activate:output}
{{ python }} {{ theia_import }} \ {{ python }} {{ theia_import }} \
--rsync {{ rsync }} \ --rsync {{ rsync }} \
--sqlite3 {{ sqlite3 }} \ --sqlite3 {{ sqlite3 }} \
...@@ -133,24 +132,24 @@ import-promises = ...@@ -133,24 +132,24 @@ import-promises =
<= monitor-promise-base <= monitor-promise-base
promise = check_command_execute promise = check_command_execute
name = resiliency-import-promise.py name = resiliency-import-promise.py
config-command = $${import-promise-script:rendered} config-command = $${import-promise-script:output}
[initial-import-exitcode-file] [initial-import-exitcode-file]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${theia-import-script:exitcode-file} output = $${theia-import-script:exitcode-file}
template = inline:0 inline = 0
once = $${:rendered} once = $${:output}
[import-promise-script] [import-promise-script]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/import-promise-script output = $${directory:bin}/import-promise-script
exitcode-file = $${initial-import-exitcode-file:rendered} exitcode-file = $${initial-import-exitcode-file:output}
context = context =
key exitcodefile :exitcode-file key exitcodefile :exitcode-file
key errorfile theia-import-script:error-file key errorfile theia-import-script:error-file
{%- raw %} {%- raw %}
template = inline =
inline:#!/bin/sh #!/bin/sh
if [ -z $(find {{ repr(exitcodefile) }} -mtime -2) ] if [ -z $(find {{ repr(exitcodefile) }} -mtime -2) ]
then then
echo "ERROR import script last ran on " $(date -r {{ repr(exitcodefile) }}) echo "ERROR import script last ran on " $(date -r {{ repr(exitcodefile) }})
......
This diff is collapsed.
...@@ -20,18 +20,17 @@ cert = $${slap-connection:cert-file} ...@@ -20,18 +20,17 @@ cert = $${slap-connection:cert-file}
recipe = slapos.cookbook:switch-softwaretype recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:default} RootSoftwareInstance = $${:default}
default = $${:theia} default = $${:theia}
theia = theia:rendered theia = theia:output
export = export:rendered export = export:output
import = import:rendered import = import:output
resilient = resilient:rendered resilient = resilient:output
frozen = instance-frozen:rendered frozen = instance-frozen:rendered
pull-backup = template-pull-backup:rendered pull-backup = template-pull-backup:rendered
[theia] [theia]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${instance-theia:output} url = ${instance-theia:output}
rendered = $${buildout:directory}/instance-theia.cfg output = $${buildout:directory}/instance-theia.cfg
mode = 0644
context = context =
jsonkey default_parameter_dict :default-parameters jsonkey default_parameter_dict :default-parameters
key parameter_dict slap-configuration:configuration key parameter_dict slap-configuration:configuration
...@@ -61,32 +60,29 @@ frontend-sr = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/ap ...@@ -61,32 +60,29 @@ frontend-sr = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/ap
[import] [import]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${instance-import:output} url = ${instance-import:output}
rendered = $${buildout:directory}/instance-import.cfg output = $${buildout:directory}/instance-import.cfg
mode = 0644
context = context =
jsonkey default_parameter_dict theia:default-parameters jsonkey default_parameter_dict theia:default-parameters
key parameter_dict slap-configuration:configuration key parameter_dict slap-configuration:configuration
key theia_instance_cfg theia:rendered key theia_instance_cfg theia:output
key pbsready_import_cfg template-pbsready-import:rendered key pbsready_import_cfg template-pbsready-import:rendered
key root_title slap-configuration:root-instance-title key root_title slap-configuration:root-instance-title
[export] [export]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${instance-export:output} url = ${instance-export:output}
rendered = $${buildout:directory}/instance-export.cfg output = $${buildout:directory}/instance-export.cfg
mode = 0644
context = context =
jsonkey default_parameter_dict theia:default-parameters jsonkey default_parameter_dict theia:default-parameters
key parameter_dict slap-configuration:configuration key parameter_dict slap-configuration:configuration
key theia_instance_cfg theia:rendered key theia_instance_cfg theia:output
key pbsready_export_cfg template-pbsready-export:rendered key pbsready_export_cfg template-pbsready-export:rendered
[resilient] [resilient]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${instance-resilient:output} url = ${instance-resilient:output}
rendered = $${buildout:directory}/instance-resilient.cfg output = $${buildout:directory}/instance-resilient.cfg
mode = 0644
extensions = jinja2.ext.do extensions = jinja2.ext.do
context = context =
key buildout buildout:bin-directory key buildout buildout:bin-directory
......
...@@ -18,30 +18,33 @@ run = $${:etc}/run ...@@ -18,30 +18,33 @@ run = $${:etc}/run
command = mkdir -p $${:run} $${:srv} command = mkdir -p $${:run} $${:srv}
[log-writer] [log-writer]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
template = inline:#!/bin/sh inline =
#!/bin/sh
echo "Hello : $(date)" >> $${directory:home}/log.log echo "Hello : $(date)" >> $${directory:home}/log.log
rendered = $${directory:run}/log-writer output = $${directory:run}/log-writer
[exporter.exclude] [exporter.exclude]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
template = inline:$${directory:home}/exclude inline = $${directory:home}/exclude
rendered = $${directory:srv}/exporter.exclude output = $${directory:srv}/exporter.exclude
[runner-import-restore] [runner-import-restore]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
template = inline:#!/bin/sh inline =
#!/bin/sh
echo "Hello : $(date)" >> $${directory:home}/runner-import-restore.log echo "Hello : $(date)" >> $${directory:home}/runner-import-restore.log
exit $TEST_RESTORE_STATUS exit $TEST_RESTORE_STATUS
rendered = $${directory:srv}/runner-import-restore output = $${directory:srv}/runner-import-restore
[backup-identity-script] [backup-identity-script]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
template = inline:#!/bin/sh inline =
#!/bin/sh
echo "Custom script" echo "Custom script"
for i in "$@" for i in "$@"
do do
echo $(sha256sum $i) echo $(sha256sum $i)
done done
exit $TEST_BACKUP_STATUS exit $TEST_BACKUP_STATUS
rendered = $${directory:srv}/.backup_identity_script output = $${directory:srv}/.backup_identity_script
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