2020-03-14 09:38:12 +00:00
|
|
|
from json import dumps
|
|
|
|
|
2020-02-29 14:42:54 +00:00
|
|
|
riot_web_root = '/var/www/{}'.format(node.metadata['riot-web']['url'])
|
|
|
|
|
|
|
|
directories = {
|
|
|
|
riot_web_root: {}
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_apt = {
|
|
|
|
'yarn': {},
|
|
|
|
}
|
|
|
|
|
|
|
|
git_deploy = {
|
|
|
|
riot_web_root: {
|
2020-03-14 09:38:12 +00:00
|
|
|
'needs': {
|
2020-02-29 14:42:54 +00:00
|
|
|
'directory:' + riot_web_root,
|
2020-03-14 09:38:12 +00:00
|
|
|
},
|
2020-02-29 14:42:54 +00:00
|
|
|
'rev': 'master',
|
|
|
|
'repo': 'https://github.com/vector-im/riot-web.git',
|
2020-03-14 09:38:12 +00:00
|
|
|
'triggers': {
|
2020-02-29 14:42:54 +00:00
|
|
|
'action:riot_yarn_install',
|
|
|
|
'action:riot_yarn_build',
|
2020-03-14 09:38:12 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
files = {
|
|
|
|
riot_web_root + '/webapp/config.json': {
|
|
|
|
'content': dumps(node.metadata['riot-web']['config']),
|
|
|
|
'needs': {
|
|
|
|
'action:riot_yarn_build',
|
|
|
|
},
|
2020-02-29 14:42:54 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
'riot_yarn_install': {
|
|
|
|
'command': 'cd ' + riot_web_root + ' && yarn install',
|
2020-03-14 09:38:12 +00:00
|
|
|
'needs': {
|
2020-02-29 14:42:54 +00:00
|
|
|
'pkg_apt:yarn',
|
2020-03-14 09:38:12 +00:00
|
|
|
},
|
2020-02-29 14:42:54 +00:00
|
|
|
'triggered': True,
|
|
|
|
},
|
|
|
|
'riot_yarn_build': {
|
|
|
|
'command': 'cd ' + riot_web_root + ' && yarn build',
|
2020-03-14 09:38:12 +00:00
|
|
|
'needs': {
|
2020-02-29 14:42:54 +00:00
|
|
|
'action:riot_yarn_install',
|
2020-03-14 09:38:12 +00:00
|
|
|
},
|
2020-02-29 14:42:54 +00:00
|
|
|
'triggered': True,
|
|
|
|
},
|
|
|
|
}
|