bundlewrap/bundles/element-web/items.py

42 lines
951 B
Python
Raw Permalink Normal View History

from bundlewrap.metadata import metadata_to_json
repo.libs.tools.require_bundle(node, 'nodejs')
directories = {
'/opt/element-web': {}
}
git_deploy = {
'/opt/element-web': {
'rev': node.metadata.get('element-web/version'),
'repo': 'https://github.com/vector-im/element-web.git',
'triggers': {
'action:element-web_yarn',
},
},
}
files = {
'/opt/element-web/webapp/config.json': {
'content': metadata_to_json(node.metadata.get('element-web/config')),
'needs': {
'action:element-web_yarn',
},
},
}
actions = {
'element-web_yarn': {
'command': ' && '.join([
'cd /opt/element-web',
'yarn install --pure-lockfile --ignore-scripts',
'yarn build',
]),
'needs': {
'action:apt_execute_update_commands',
'pkg_apt:nodejs',
},
'triggered': True,
},
}