bundles/riot-web: add metadata to write config.json

This commit is contained in:
Franzi 2020-03-14 09:38:12 +00:00
parent 589965b58b
commit b4808d54e9
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -1,3 +1,5 @@
from json import dumps
riot_web_root = '/var/www/{}'.format(node.metadata['riot-web']['url'])
directories = {
@ -10,31 +12,40 @@ pkg_apt = {
git_deploy = {
riot_web_root: {
'needs': [
'needs': {
'directory:' + riot_web_root,
],
},
'rev': 'master',
'repo': 'https://github.com/vector-im/riot-web.git',
'triggers': [
'triggers': {
'action:riot_yarn_install',
'action:riot_yarn_build',
],
},
},
}
files = {
riot_web_root + '/webapp/config.json': {
'content': dumps(node.metadata['riot-web']['config']),
'needs': {
'action:riot_yarn_build',
},
},
}
actions = {
'riot_yarn_install': {
'command': 'cd ' + riot_web_root + ' && yarn install',
'needs': [
'needs': {
'pkg_apt:yarn',
],
},
'triggered': True,
},
'riot_yarn_build': {
'command': 'cd ' + riot_web_root + ' && yarn build',
'needs': [
'needs': {
'action:riot_yarn_install',
],
},
'triggered': True,
},
}