add bundle for mx-puppet-discord
This commit is contained in:
parent
1856f4749c
commit
4c5a88f734
4 changed files with 135 additions and 0 deletions
69
bundles/mx-puppet-discord/items.py
Normal file
69
bundles/mx-puppet-discord/items.py
Normal file
|
@ -0,0 +1,69 @@
|
|||
assert node.has_bundle('nodejs')
|
||||
|
||||
directories = {
|
||||
'/var/log/mx-puppet-discord': {
|
||||
'owner': 'mx-puppet-discord',
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/opt/mx-puppet-discord/config.yaml': {
|
||||
'owner': 'mx-puppet-discord',
|
||||
'content_type': 'mako',
|
||||
'needs': {
|
||||
'git_deploy:/opt/mx-puppet-discord',
|
||||
},
|
||||
'triggers': {
|
||||
'action:mx-puppet-discord_generate_registration',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/mx-puppet-discord': {
|
||||
'repo': 'https://github.com/matrix-discord/mx-puppet-discord.git',
|
||||
'rev': 'master',
|
||||
'needs': {
|
||||
'directory:/opt/mx-puppet-discord',
|
||||
},
|
||||
'triggers': {
|
||||
'action:mx-puppet-discord_chown',
|
||||
'action:mx-puppet-discord_npm_install',
|
||||
'action:mx-puppet-discord_npm_build',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'mx-puppet-discord_chown': {
|
||||
'command': 'chown -R mx-puppet-discord:mx-puppet-discord /opt/mx-puppet-discord/*',
|
||||
'needed_by': {
|
||||
'action:mx-puppet-discord_npm_install',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
'mx-puppet-discord_npm_install': {
|
||||
'command': 'cd /opt/mx-puppet-discord && sudo -u mx-puppet-discord npm install',
|
||||
'needs': {
|
||||
'pkg_apt:nodejs',
|
||||
'user:mx-puppet-discord',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
'mx-puppet-discord_npm_build': {
|
||||
'command': 'cd /opt/mx-puppet-discord && sudo -u mx-puppet-discord npm run-script build',
|
||||
'needs': {
|
||||
'action:mx-puppet-discord_npm_install',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
'mx-puppet-discord_generate_registration': {
|
||||
'command': 'cd /opt/mx-puppet-discord && sudo -u mx-puppet-discord node ./build/index.js -r -c /opt/mx-puppet-discord/config.yaml -f /opt/mx-puppet-discord/registration.yaml',
|
||||
'needs': {
|
||||
'user:mx-puppet-discord',
|
||||
'action:mx-puppet-discord_npm_build',
|
||||
'directory:/var/log/mx-puppet-discord',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue