TYPO3\Surf\Task\CleanupReleasesTask

class CleanupReleasesTask

A cleanup task to delete old (unused) releases.

Cleanup old releases by listing all releases and keeping a configurable number of old releases (application option “keepReleases”). The current and previous release (if one exists) are protected from removal.

Note: There is no rollback for this cleanup, so we have to be sure not to delete any live or referenced releases.

It takes the following options:

  • keepReleases - The number of releases to keep.
  • onlyRemoveReleasesOlderThanXSeconds - Remove only those releases older than the defined seconds
Example configuration:
$application->setOption(‘keepReleases’, 2); $application->setOption(‘onlyRemoveReleasesOlderThan’, ‘121 seconds ago’)

Note: There is no rollback for this cleanup, so we have to be sure not to delete any live or referenced releases.

property shell

protected ShellCommandService

__construct(ClockInterface $clock = null)

CleanupReleasesTask constructor.

Parameters:
execute(Node $node, Application $application, Deployment $deployment, $options = [])

Execute this task

Parameters:
Returns:

void|null

simulate(Node $node, Application $application, Deployment $deployment, $options = [])

Simulate this task

Parameters:
removeReleasesByAge($options, $removableReleases)
Parameters:
  • $options (array) –
  • $removableReleases (array) –
Returns:

array

removeReleasesByNumber($options, $removableReleases)
Parameters:
  • $options (array) –
  • $removableReleases (array) –
Returns:

array

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

Rollback this task

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

array

resolveOptions(OptionsResolver $resolver)
Parameters:
  • $resolver (OptionsResolver) –