Commit 81320b0e authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Add autorun option

`autorun` controls the `slapos-node-auto` service:
  - `running`: start `slapos-node-auto`
  - `stopped`: stop `slapos-node-auto`
  - ( else ) : leave `slapos-node-auto` as it is

See merge request nexedi/slapos!888
parent fe01551b
Pipeline #13684 failed with stage
in 0 seconds
......@@ -15,7 +15,7 @@
[instance]
filename = instance.cfg.in
md5sum = a3e4cb7d28daa7816f04359c8aa3445b
md5sum = 524c0b40d6ee49841fdbb2cf26fd1833
[yarn.lock]
filename = yarn.lock
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Parameters to instantiate Theia",
"additionalProperties": false,
"properties": {
"autorun": {
"title": "autorun",
"description": "State of the autorun service",
"type": "string",
"enum": [
"running",
"stopped",
"disabled"
],
"default": "running"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by Theia instanciation",
"properties": {
"url": {
"description": "Theia Frontend URL",
"type": "string"
},
"username": {
"description": "Theia username",
"type": "string"
},
"password": {
"description": "Theia password",
"type": "string"
}
},
"type": "object"
}
......@@ -338,6 +338,7 @@ instance-promises =
$${frontend-listen-promise:name}
$${apache-frontend-url-available-promise:name}
$${slapos-standalone-listen-promise:name}
$${slapos-autorun-promise:name}
[theia-listen-promise]
<= monitor-promise-base
......@@ -368,6 +369,14 @@ name = standalone-listen-promise.py
config-hostname = $${slapos-standalone-instance:hostname}
config-port = $${slapos-standalone-instance:port}
[slapos-autorun-promise]
<= monitor-promise-base
module = check_service_state
# XXX promise plugins can not contain "slapos" in their names
name = autorun-state-promise.py
config-service = $${slapos-autorun:service-name}
config-expect = $${slapos-autorun:autorun}
[apache-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
......@@ -394,6 +403,19 @@ partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
configuration.autorun = running
[slapos-autorun]
recipe = plone.recipe.command
command =
case $${:autorun} in
( running ) ${buildout:bin-directory}/supervisorctl -c $${:supervisor-conf} start $${:service-name};;
( stopped ) ${buildout:bin-directory}/supervisorctl -c $${:supervisor-conf} stop $${:service-name};;
esac
update-command = $${:command}
service-name = slapos-node-auto
supervisor-conf = $${directory:runner}/etc/supervisord.conf
autorun = $${instance-parameter:configuration.autorun}
[slapos-repository]
recipe = slapos.recipe.build:gitclone
......
{
"name": "Theia",
"description": "Theia",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"software-type": "default",
"description": "Default",
"request": "instance-input-schema.json",
"response": "instance-ouput-schema.json",
"index": 1
}
}
}
......@@ -192,7 +192,7 @@ setuptools-dso = 1.7
rubygemsrecipe = 0.3.0
six = 1.12.0
slapos.cookbook = 1.0.171
slapos.core = 1.6.3
slapos.core = 1.6.4
slapos.extension.strip = 0.4
slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.20
......@@ -200,7 +200,7 @@ slapos.rebootstrap = 4.5
slapos.recipe.build = 0.46
slapos.recipe.cmmi = 0.16
slapos.recipe.template = 4.5
slapos.toolbox = 0.116
slapos.toolbox = 0.117
stevedore = 1.21.0
subprocess32 = 3.5.3
unicodecsv = 0.14.1
......
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