From 944c66354bb53562501c13f90585e7b905e2b46b Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 10 Sep 2022 18:10:14 +0200 Subject: [PATCH] bundles/mx-puppet-discord: github is archived, gitlab is the new hotness --- bundles/mx-puppet-discord/items.py | 30 ++++++++++++++++++------------ nodes/rx300.py | 2 -- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/bundles/mx-puppet-discord/items.py b/bundles/mx-puppet-discord/items.py index 6552d0c..8e17928 100644 --- a/bundles/mx-puppet-discord/items.py +++ b/bundles/mx-puppet-discord/items.py @@ -6,6 +6,10 @@ directories = { 'owner': 'mx-puppet-discord', 'group': 'mx-puppet-discord', }, + '/opt/mx-puppet-discord/.yarn': { + 'owner': 'mx-puppet-discord', + 'group': 'mx-puppet-discord', + }, '/opt/mx-puppet-discord/src': { 'owner': 'mx-puppet-discord', 'group': 'mx-puppet-discord', @@ -47,29 +51,31 @@ files = { git_deploy = { '/opt/mx-puppet-discord/src': { - 'repo': 'https://github.com/matrix-discord/mx-puppet-discord.git', - 'rev': node.metadata.get('mx-puppet-discord/version', 'master'), + 'repo': 'https://gitlab.com/mx-puppet/discord/mx-puppet-discord.git', + 'rev': node.metadata.get('mx-puppet-discord/version', 'main'), 'triggers': { 'action:mx-puppet-discord_chown', - 'action:mx-puppet-discord_npm_install', - 'action:mx-puppet-discord_npm_build', + 'action:mx-puppet-discord_yarn_install', + 'action:mx-puppet-discord_yarn_build', }, }, } actions = { 'mx-puppet-discord_chown': { - 'command': - 'chown -R mx-puppet-discord:mx-puppet-discord /opt/mx-puppet-discord/src && ' + 'command': ' && '.join([ 'chown -R mx-puppet-discord:mx-puppet-discord /opt/mx-puppet-discord/.npm', + 'chown -R mx-puppet-discord:mx-puppet-discord /opt/mx-puppet-discord/.yarn', + 'chown -R mx-puppet-discord:mx-puppet-discord /opt/mx-puppet-discord/src', + ]), 'needs': { 'directory:/opt/mx-puppet-discord/.npm', 'user:mx-puppet-discord', }, 'triggered': True, }, - 'mx-puppet-discord_npm_install': { - 'command': 'cd /opt/mx-puppet-discord/src && sudo -u mx-puppet-discord npm install', + 'mx-puppet-discord_yarn_install': { + 'command': 'cd /opt/mx-puppet-discord/src && sudo -u mx-puppet-discord yarn install', 'needs': { 'action:mx-puppet-discord_chown', 'pkg_apt:nodejs', @@ -77,10 +83,10 @@ actions = { }, 'triggered': True, }, - 'mx-puppet-discord_npm_build': { - 'command': 'cd /opt/mx-puppet-discord/src && sudo -u mx-puppet-discord npm run-script build', + 'mx-puppet-discord_yarn_build': { + 'command': 'cd /opt/mx-puppet-discord/src && sudo -u mx-puppet-discord yarn build', 'needs': { - 'action:mx-puppet-discord_npm_install', + 'action:mx-puppet-discord_yarn_install', }, 'triggers': { 'svc_systemd:mx-puppet-discord:restart', @@ -92,7 +98,7 @@ actions = { svc_systemd = { 'mx-puppet-discord': { 'needs': { - 'action:mx-puppet-discord_npm_build', + 'action:mx-puppet-discord_yarn_build', 'file:/etc/systemd/system/mx-puppet-discord.service', 'file:/opt/mx-puppet-discord/config.yaml', 'file:/opt/mx-puppet-discord/registration.yaml', diff --git a/nodes/rx300.py b/nodes/rx300.py index 3d4f80f..f1649b6 100644 --- a/nodes/rx300.py +++ b/nodes/rx300.py @@ -281,8 +281,6 @@ nodes['rx300'] = { 'domain': 'rss.franzi.business', }, 'mx-puppet-discord': { - # https://github.com/matrix-discord/mx-puppet-discord/issues/201 - 'version': '46051012ec3d4e21bd9febc2519ce08f3e13f5e0', 'homeserver': { 'domain': 'franzi.business', 'url': 'https://matrix.franzi.business',