bangpound/invoker-bundle

Manage server processes in your Symfony development environment

dev-master / 1.0.x-dev 2014-09-25 16:43 UTC

This package is auto-updated.

Last update: 2024-11-12 03:31:55 UTC


README

This bundle imitates some of the functionality of invoker to run services in development environments.

Usage

Enable the bundle in your kernel.

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Bangpound\Bundle\InvokerBundle\BangpoundInvokerBundle(),
    );
}

Create ProcessBuilder services for each process this bundle should launch.

    bangpound_castle.process.elasticsearch:
        class: Bangpound\Bundle\InvokerBundle\Process\ProcessBuilder
        arguments: [ ["/usr/local/bin/elasticsearch", "--config=/usr/local/opt/elasticsearch/config/elasticsearch.yml"] ]
        calls:
            - [ setTimeout, [ ~ ]]
        tags:
            - { name: bangpound_invoker.server }

    bangpound_castle.process.couchdb:
        class: Bangpound\Bundle\InvokerBundle\Process\ProcessBuilder
        arguments: [ ["couchdb" ] ]
        calls:
            - [ setTimeout, [ ~ ]]
        tags:
            - { name: bangpound_invoker.server }

    bangpound_castle.process.rabbitmq:
        class: Bangpound\Bundle\InvokerBundle\Process\ProcessBuilder
        arguments: [ ["rabbitmq-server"] ]
        calls:
            - [ setTimeout, [ ~ ]]
        tags:
            - { name: bangpound_invoker.server }

Then run the Symfony console command invoker.

./bin/console invoker -vv

Using the verbosity flags will cause process output to be logged to the console, which is usually desireable.

This is a bundle that should only be used for development environments. Do not use this bundle in production. Instead use your operating system's service initialization such as systemd or init.d and/or use supervisord.