repo.libs.tools.require_bundle(node, 'nodejs') directories = { node.metadata['matrix-dimension']['install_dir']: {}, node.metadata['matrix-dimension']['data_dir']: {}, } git_deploy = { node.metadata['matrix-dimension']['install_dir']: { 'rev': node.metadata.get('matrix-dimension', {}).get('version', 'master'), # doesn't have releases yet 'repo': 'https://github.com/turt2live/matrix-dimension.git', 'triggers': { 'action:matrix_dimension_build', }, 'needs': { 'directory:{}'.format(node.metadata['matrix-dimension']['install_dir']), 'directory:{}'.format(node.metadata['matrix-dimension']['data_dir']), }, }, } files = { '{}/config/production.yaml'.format(node.metadata['matrix-dimension']['install_dir']): { 'content_type': 'mako', 'context': { 'config': node.metadata.get('matrix-dimension', {}), }, 'needs': { 'action:element-web_yarn', 'directory:{}'.format(node.metadata['matrix-dimension']['install_dir']), }, }, '/etc/systemd/system/matrix-dimension.service': { 'content_type': 'mako', 'context': { 'config': node.metadata.get('matrix-dimension', {}), }, 'triggers': { 'action:systemd-reload', 'svc_systemd:matrix-dimension:restart', }, }, } actions = { 'matrix_dimenson_build': { 'command': 'cd ' + node.metadata['matrix-dimension']['install_dir'] + ' && npm install && npm run build', 'needs': { 'pkg_apt:nodejs', }, 'triggered': True, 'triggers': { 'svc_systemd:matrix-dimension:restart', }, }, } svc_systemd = { 'matrix-dimension': { 'needs': { 'action:matrix-dimension_build', 'file:{}/config/production.yaml'.format(node.metadata['matrix-dimension']['install_dir']), 'postgres_db:matrix-dimension', 'postgres_role:matrix-dimension', }, }, }