bundlewrap/bundles/riot-web/items.py
2020-08-18 15:31:52 +02:00

47 lines
996 B
Python

assert node.has_bundle('nodejs')
from json import dumps
riot_web_root = '/var/www/{}'.format(node.metadata['riot-web']['url'])
directories = {
riot_web_root: {}
}
git_deploy = {
riot_web_root: {
'rev': 'master',
'repo': 'https://github.com/vector-im/riot-web.git',
'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': {
'pkg_apt:yarn',
},
'triggered': True,
},
'riot_yarn_build': {
'command': 'cd ' + riot_web_root + ' && yarn build',
'needs': {
'action:riot_yarn_install',
},
'triggered': True,
},
}