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',
    },
}