bundles/element-web: rename from riot-web, use tagged releases
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-02-16 12:49:02 +01:00
parent d1b1ca7729
commit 9d5d80457f
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 93 additions and 81 deletions

View file

@ -0,0 +1,38 @@
assert node.has_bundle('nodejs')
from json import dumps
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': {
'content': dumps(node.metadata['element-web']['config']),
'needs': {
'action:element-web_yarn',
},
},
}
actions = {
'element-web_yarn': {
'command': 'cd ' + element_web_root + ' && yarn install && yarn build',
'needs': {
'pkg_apt:yarn',
},
'triggered': True,
},
}

View file

@ -0,0 +1,33 @@
@metadata_reactor.provides(
'nginx/vhosts',
)
def nginx_config(metadata):
return {
'nginx': {
'vhosts': {
metadata.get('element-web/url'): {
'webroot': '/var/www/{}/webapp/'.format(metadata.get('element-web/url')),
'extras': True,
},
},
},
}
@metadata_reactor.provides(
'icinga2_api/element-web/services',
)
def icinga_check_for_new_release(metadata):
return {
'icinga2_api': {
'element-web': {
'services': {
'ELEMENT-WEB UPDATE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release vector-im/element-web {}'.format(metadata.get('element-web/version')),
'vars.notification.mail': True,
'check_interval': '60m',
},
},
},
},
}

View file

@ -1,46 +0,0 @@
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,
},
}

View file

@ -1,14 +0,0 @@
@metadata_reactor.provides(
'nginx/vhosts',
)
def nginx_config(metadata):
return {
'nginx': {
'vhosts': {
metadata.get('riot-web/url', None): {
'webroot': '/var/www/{}/webapp/'.format(metadata.get('riot-web/url', None)),
'extras': True,
},
},
},
}