2021-02-20 10:10:08 +00:00
|
|
|
from bundlewrap.metadata import metadata_to_json
|
2021-02-16 11:49:02 +00:00
|
|
|
|
2021-04-02 16:57:13 +00:00
|
|
|
repo.libs.tools.require_bundle(node, 'nodejs')
|
|
|
|
|
2021-02-16 11:49:02 +00:00
|
|
|
element_web_root = '/var/www/{}'.format(node.metadata['element-web']['url'])
|
|
|
|
|
|
|
|
directories = {
|
|
|
|
element_web_root: {}
|
|
|
|
}
|
|
|
|
|
|
|
|
git_deploy = {
|
|
|
|
element_web_root: {
|
|
|
|
'rev': node.metadata['element-web']['version'],
|
|
|
|
'repo': 'https://github.com/vector-im/element-web.git',
|
|
|
|
'triggers': {
|
|
|
|
'action:element-web_yarn',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
files = {
|
|
|
|
element_web_root + '/webapp/config.json': {
|
2021-02-20 10:10:08 +00:00
|
|
|
'content': metadata_to_json(node.metadata['element-web']['config']),
|
2021-02-16 11:49:02 +00:00
|
|
|
'needs': {
|
|
|
|
'action:element-web_yarn',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
'element-web_yarn': {
|
|
|
|
'command': 'cd ' + element_web_root + ' && yarn install && yarn build',
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:yarn',
|
|
|
|
},
|
|
|
|
'triggered': True,
|
|
|
|
},
|
|
|
|
}
|