diff --git a/bundles/riot-web/items.py b/bundles/riot-web/items.py index 337225f..c739965 100644 --- a/bundles/riot-web/items.py +++ b/bundles/riot-web/items.py @@ -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, }, }