TYPO3\Surf\Task\Composer\CommandTask

class CommandTask

Runs a custom composer command

It takes the following options:

  • composerCommandPath - Path to the composer binary
  • command - The composer command to run
  • nodeName - The name of the node where the composer command should run.
  • arguments (optional) - Array of arguments to pass to the composer command, default –no-ansi –no-interaction
  • additionalArguments (optional) - Array of additional arguments to pass to composer and keep default arguments
  • suffix (optional) - Array, string or null with the suffix command, either [‘2>&1’], [], ‘2>&1’, ‘’ or null
  • useApplicationWorkspace (optional) - If true Surf uses the workspace path, else it uses the release path of the application.
Example:
$workflow->defineTask(‘My\Distribution\DefinedTask\RunBuildScript’, TYPO3SurfTaskComposerCommandTask::class, [
‘composerCommandPath’ => ‘/usr/local/bin/composer’, ‘nodeName’ => ‘localhost’, ‘command’ => ‘run-script’, ‘additionalArguments’ => [‘build’], ‘useApplicationWorkspace’ => true

]); $workflow->afterTask(‘TYPO3\Surf\DefinedTask\Composer\LocalInstallTask’, ‘My\Distribution\DefinedTask\RunBuildScript’, $application);

composer ‘run-script’ ‘–no-ansi’ ‘–no-interaction’ ‘build’ 2>&1$

property command

protected string

Command to run

property arguments

protected array

Arguments for the command

property suffix

protected array

Suffix for the command

property shell

protected ShellCommandService

execute(Node $node, Application $application, Deployment $deployment, $options = [])
Parameters:
resolveOptions(OptionsResolver $resolver)
Parameters:
  • $resolver (OptionsResolver) –
simulate(Node $node, Application $application, Deployment $deployment, $options = [])

Simulate this task

Parameters:
buildComposerCommands($manifestPath, $options)

Build the composer command in the given $path.

Parameters:
  • $manifestPath (string) –
  • $options (array) –
Returns:

array

composerManifestExists($path, Node $node, Deployment $deployment)

Checks if a composer manifest exists in the directory at the given path.

If no manifest exists, a log message is recorded.

Parameters:
Returns:

bool

setShellCommandService(ShellCommandService $shellCommandService)
Parameters:
rollback(Node $node, Application $application, Deployment $deployment, $options = [])

Rollback this task

Parameters:
configureOptions($options = [])
Parameters:
  • $options (array) –
Returns:

array