Setup


Technical requirements

Before creating your first middleware application you must :

Creating your project

mkdir path/to/project

To create a new project, you will need to initialize composer. Open your console terminal and run this command:

composer init

Notice: You must choose dev as the value for the minimum-stability option.

Composer will create a composer.json file, you will need to add the following lines:

"config": {
    "bin-dir": "bin"
},
"scripts": {
    "post-install-cmd": [
        "Kiboko\\Component\\Satellite\\ComposerScripts::postInstall"
    ],
    "post-update-cmd": [
        "Kiboko\\Component\\Satellite\\ComposerScripts::postUpdate"
    ]
}

In order to install the satellite compiler, run the following in your console:

composer require php-etl/satellite

This command will add the php-etl/satellite package. It is the compiler of Gyroscops.

Once the compiler installed, you may need to add some plugins. Check out the plugins list to know which one you may need.

Example, if you need the Akeneo Plugin:

composer require "php-etl/akeneo-expression-language:*" "php-etl/akeneo-plugin:*"

Start creating your micro-service

Now that you have set up your project, go to Creating Satellites.

Running the pipeline

Once you have completed your configuration, you will be able to compile your satellites:

# php bin/satellite build <path-to-your-config-file>
php bin/satellite build path/to/project/satellite.yaml

Notice: You will need to run this command every time you change your configuration files.

This command will build your satellite service, either inside a Docker image or inside a filesystem directory.

If you built inside the filesystem

# php <path-to-the-generated-satellite>
php path/to/project/build/folder/

This command will run your satellite service located in a directory. The execution of your service may take several minutes, so please wait until the execution is completed.

If you built as a Docker image

# docker run --rm -ti <generated-satellite-docker-image-name>
docker run --rm -ti foo/satellite-name:latest

This command will run your satellite service located in a Docker image. The execution of your service may take several minutes, so please wait until the execution is completed.