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