TYPO3 Flow Base DistributionPackagesApplications

Feature #63330

Allow node/application/deployment options as options of defined tasks

Added by Joachim Mathes 8 months ago. Updated 6 months ago.

Status:Needs Feedback Start date:2014-11-25
Priority:Could have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-

Description

Up to now it is possible to reuse a task like typo3.surf:shell with $workflow->defineTask('fooTask', 'typo3.surf:shell', array('command' => 'echo "Hello"')) and dedicated parameters. But what if I want node options to overwrite the parameters of a defined task, e.g.:

<?php

$nodeConfigurations = array(
    array(
        'name' => 'one',
        'run' => 'echo "I am node one"'
    ),
    array(
        'name' => 'two',
        'run' => 'echo "I am node two"'
    )
);

$application = new \TYPO3\Surf\Domain\Model\Application('DummyApplication');

foreach ($nodeConfigurations as $configuration) {
    $node = new \TYPO3\Surf\Domain\Model\Node($configuration['name']);
    $node
        ->setOptions(array(
            'hostname' => 'localhost',
            'username' => 'jo',
            'getNodeOptions[command]' => $configuration['run']
        ));

    $application
        ->addNode($node);
}

$workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow();
$workflow
    ->defineTask('getNodeOptions', 'typo3.surf:shell', array())
    ->addTask('getNodeOptions', 'transfer');

$deployment
    ->setWorkflow($workflow)
    ->addApplication($application); 

This does not work for now. Maybe the provided patch is a solution. This is a quick idea, so please review carefully.

History

#1 Updated by Christopher Hlubek 6 months ago

Hi Joachim,

I couldn't find the patch you mentioned. Could you attach it to this issue?

In general this is a good idea to have, we just need to have a clear and understandable merge order of deployment, application, node and task options.

#2 Updated by Christopher Hlubek 6 months ago

  • Status changed from New to Needs Feedback

#3 Updated by Joachim Mathes 6 months ago

Hi Christopher,

This is my commit: https://review.typo3.org/#/c/34621/

Also available in: Atom PDF