Exemplo n.º 1
0
from fabric.utils import abort

from refabric.api import info
from refabric.context_managers import sudo
from refabric.contrib import blueprints
from refabric.operations import run

from . import debian

__all__ = [
    'start', 'stop', 'restart', 'status', 'force_reload',
    'setup', 'configure', 'install', 'set_password',
]


blueprint = blueprints.get(__name__)

service_name = 'neo4j-service'
start = debian.service_task(service_name, 'start')
stop = debian.service_task(service_name, 'stop')
restart = debian.service_task(service_name, 'restart')
status = debian.service_task(service_name, 'status', show_output=True)
force_reload = debian.service_task(service_name, 'force-reload')


@task
def setup():
    """
    Install and configure Neo4j
    """
    install()
Exemplo n.º 2
0
from refabric.contrib import blueprints

blueprint = blueprints.get('app')


def list_providers():
    from .celery import CeleryProvider
    from .uwsgi import UWSGIProvider
    from .node import NodeProvider
    from .gunicorn import GunicornProvider
    from .program import ProgramProvider

    return [
        CeleryProvider,
        UWSGIProvider,
        NodeProvider,
        GunicornProvider,
        ProgramProvider
    ]


def get_providers(host=None):
    """
    Get configured web/worker providers by host.

    :param host: Provider host filter
    :return: dict(web=<provider>, worker=<provider>)
    """
    from .. import resolve_runners
    providers = {}
Exemplo n.º 3
0
        # network_bind_host: 127.0.0.1     # Set the bind address specifically, IPv4 or IPv6 (Default: 0.0.0.0)
        # network_publish_host: 127.0.0.1  # Set the address other nodes will use to communicate with this node (Optional)
        # network_host: 127.0.0.1          # Set both `network_bind_host` and `network_publish_host` (Optional)

"""
from fabric.decorators import task

from refabric.api import info
from refabric.context_managers import sudo
from refabric.contrib import blueprints

from . import debian

__all__ = ['start', 'stop', 'restart', 'reload', 'setup', 'configure']

blueprint = blueprints.get(__name__)

start = debian.service_task('elasticsearch', 'start')
stop = debian.service_task('elasticsearch', 'stop')
restart = debian.service_task('elasticsearch', 'restart')
reload = debian.service_task('elasticsearch', 'force-reload')


@task
def setup():
    """
    Install Elasticsearch
    """
    install()
    configure()
Exemplo n.º 4
0
from contextlib import contextmanager

from fabric.context_managers import prefix, cd

from refabric.context_managers import sudo
from refabric.contrib import blueprints
from refabric.operations import run

from ... import node, debian

from ..project import sudo_project, project_home, git_repository_path,\
    static_base

from .base import ManagedProvider

blueprint = blueprints.get('blues.app')


@contextmanager
def bash_profile():
    """
    Fixes stuff that non-interactive shells don't do automatically.
    """
    with prefix('export HOME={}'.format(project_home())), \
            prefix('source {}/.bash_profile'.format(project_home())):
        yield


class NodeProvider(ManagedProvider):
    name = 'node'
    default_manager = 'nginx'