replace matrix-dimension on rx300 with matrix-stickerpicker on carlene
This commit is contained in:
parent
fc75e92a78
commit
b08c9fb5a4
9 changed files with 98 additions and 330 deletions
7
bundles/matrix-stickerpicker/files/sticker-import
Normal file
7
bundles/matrix-stickerpicker/files/sticker-import
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
/opt/matrix-stickerpicker/venv/bin/sticker-import \
|
||||
--config /opt/matrix-stickerpicker/config.json \
|
||||
--session /opt/matrix-stickerpicker/sticker-import.session \
|
||||
--output-dir /var/opt/matrix-stickerpicker/ \
|
||||
"$@"
|
47
bundles/matrix-stickerpicker/items.py
Normal file
47
bundles/matrix-stickerpicker/items.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
actions['matrix-stickerpicker_create_virtualenv'] = {
|
||||
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/matrix-stickerpicker/venv/',
|
||||
'unless': 'test -d /opt/matrix-stickerpicker/venv/',
|
||||
'needs': {
|
||||
# actually /opt/matrix-stickerpicker, but we don't create that
|
||||
'directory:/opt/matrix-stickerpicker/src',
|
||||
},
|
||||
}
|
||||
|
||||
actions['matrix-stickerpicker_install'] = {
|
||||
'command': 'cd /opt/matrix-stickerpicker/src && /opt/matrix-stickerpicker/venv/bin/pip install --upgrade pip .',
|
||||
'needs': {
|
||||
'action:matrix-stickerpicker_create_virtualenv',
|
||||
},
|
||||
'triggered': True,
|
||||
}
|
||||
|
||||
users['matrix-stickerpicker'] = {
|
||||
'home': '/opt/matrix-stickerpicker',
|
||||
}
|
||||
|
||||
files['/usr/local/bin/sticker-import'] = {
|
||||
'mode': '0700',
|
||||
}
|
||||
|
||||
files['/opt/matrix-stickerpicker/config.json'] = {
|
||||
'content': repo.libs.faults.dict_as_json(node.metadata.get('matrix-stickerpicker/config')),
|
||||
}
|
||||
|
||||
directories['/opt/matrix-stickerpicker/src'] = {}
|
||||
|
||||
directories['/var/opt/matrix-stickerpicker'] = {}
|
||||
|
||||
git_deploy['/opt/matrix-stickerpicker/src'] = {
|
||||
'repo': 'https://github.com/maunium/stickerpicker.git',
|
||||
'rev': node.metadata.get('matrix-stickerpicker/version', 'master'),
|
||||
'triggers': {
|
||||
'action:matrix-stickerpicker_install',
|
||||
},
|
||||
}
|
||||
|
||||
symlinks['/opt/matrix-stickerpicker/src/web/packs'] = {
|
||||
'target': '/var/opt/matrix-stickerpicker',
|
||||
'after': {
|
||||
'git_deploy:/opt/matrix-stickerpicker/src',
|
||||
},
|
||||
}
|
35
bundles/matrix-stickerpicker/metadata.py
Normal file
35
bundles/matrix-stickerpicker/metadata.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
defaults = {
|
||||
'backups': {
|
||||
'paths': '/var/opt/matrix-stickerpicker',
|
||||
},
|
||||
'zfs': {
|
||||
'datasets': {
|
||||
'tank/matrix-stickerpicker': {
|
||||
'mountpoint': '/var/opt/matrix-stickerpicker',
|
||||
'needed_by': {
|
||||
'directory:/var/opt/matrix-stickerpicker',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nginx/vhosts/matrix-stickerpicker',
|
||||
)
|
||||
def nginx(metadata):
|
||||
if not node.has_bundle('nginx'):
|
||||
raise DoNotRunAgain
|
||||
|
||||
return {
|
||||
'nginx': {
|
||||
'vhosts': {
|
||||
'matrix-stickerpicker': {
|
||||
'domain': metadata.get('matrix-stickerpicker/domain'),
|
||||
'do_not_set_content_security_headers': True,
|
||||
'webroot': '/opt/matrix-stickerpicker/src/web/',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue