bundles/hedgedoc add new bundle
This commit is contained in:
parent
25d7657e7d
commit
478a8da9f4
3 changed files with 264 additions and 0 deletions
87
bundles/hedgedoc/items.py
Normal file
87
bundles/hedgedoc/items.py
Normal file
|
@ -0,0 +1,87 @@
|
|||
from bundlewrap.metadata import metadata_to_json
|
||||
|
||||
repo.libs.tools.require_bundle(node, 'nodejs')
|
||||
|
||||
directories = {
|
||||
'/opt/hedgedoc': {}
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/hedgedoc': {
|
||||
'rev': node.metadata.get('hedgedoc/version'),
|
||||
'repo': 'https://github.com/hedgedoc/hedgedoc.git',
|
||||
'needs': {
|
||||
'directory:/opt/hedgedoc',
|
||||
},
|
||||
'triggers': {
|
||||
'action:hedgedoc_yarn',
|
||||
'svc_systemd:hedgedoc:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/opt/hedgedoc/config.json': {
|
||||
'content': metadata_to_json(node.metadata.get('hedgedoc/config')),
|
||||
'needs': {
|
||||
'git_deploy:/opt/hedgedoc',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:hedgedoc:restart',
|
||||
},
|
||||
},
|
||||
'/etc/systemd/system/hedgedoc.service': {
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
'svc_systemd:hedgedoc:restart',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/opt/hedgedoc': {},
|
||||
'/var/opt/hedgedoc': {
|
||||
'owner': 'hedgedoc',
|
||||
'group': 'hedgedoc',
|
||||
},
|
||||
'/opt/hedgedoc/.yarn': {
|
||||
'owner': 'hedgedoc',
|
||||
'group': 'hedgedoc',
|
||||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'hedgedoc_yarn': {
|
||||
'command': ' && '.join([
|
||||
'cd /opt/hedgedoc',
|
||||
'npm install yarn',
|
||||
'node_modules/yarn/bin/yarn install --production=true --pure-lockfile',
|
||||
'node_modules/yarn/bin/yarn install',
|
||||
'node_modules/yarn/bin/yarn build',
|
||||
]),
|
||||
'needs': {
|
||||
'file:/opt/hedgedoc/config.json',
|
||||
'git_deploy:/opt/hedgedoc',
|
||||
'pkg_apt:nodejs',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'hedgedoc': {
|
||||
'needs': {
|
||||
'file:/opt/hedgedoc/config.json',
|
||||
'directory:/var/opt/hedgedoc',
|
||||
'directory:/opt/hedgedoc/.yarn',
|
||||
'action:hedgedoc_yarn',
|
||||
'postgres_db:hedgedoc',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
users = {
|
||||
'hedgedoc': {
|
||||
'home': '/opt/hedgedoc',
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue