Skip to content

Commit

Permalink
TASK: Deprecate some old Tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Apr 7, 2023
1 parent aafc981 commit e5f340b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Task/Composer/DownloadTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,29 @@
* ]
* );
*/
/**
* @deprecated Will be removed in version 4.0
*/
class DownloadTask extends Task implements ShellCommandServiceAwareInterface
{
use ShellCommandServiceAwareTrait;

public function execute(Node $node, Application $application, Deployment $deployment, array $options = []): void
{
$this->logger->warning('This task is deprecated and will be remove in Version 4.0');
$options = $this->configureOptions($options);

$command = sprintf('cd %s && %s', escapeshellarg($deployment->getApplicationReleasePath($node)), $options['composerDownloadCommand']);

$this->shell->executeOrSimulate($command, $node, $deployment);
}

public function simulate(Node $node, Application $application, Deployment $deployment, array $options = []): void
{
$this->logger->warning('This task is deprecated and will be remove in Version 4.0');
parent::simulate($node, $application, $deployment, $options);
}

protected function resolveOptions(OptionsResolver $resolver): void
{
$resolver->setDefault('composerDownloadCommand', 'curl -s https://getcomposer.org/installer | php');
Expand Down
4 changes: 4 additions & 0 deletions src/Task/CreateArchiveTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
* ]
* );
*/
/**
* @deprecated Will be removed in version 4.0
*/
class CreateArchiveTask extends Task implements ShellCommandServiceAwareInterface
{
use ShellCommandServiceAwareTrait;
Expand All @@ -64,6 +67,7 @@ public function __construct(FilesystemInterface $filesystem, IdGeneratorInterfac

public function execute(Node $node, Application $application, Deployment $deployment, array $options = []): void
{
$this->logger->warning('This task is deprecated and will be remove in Version 4.0');
$options = $this->configureOptions($options);

$this->shell->execute('rm -f ' . $options['targetFile'] . '; mkdir -p ' . dirname($options['targetFile']), $node, $deployment);
Expand Down
5 changes: 5 additions & 0 deletions src/Task/DumpDatabaseTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@
* ]
* );
*/

/**
* @deprecated Will be removed in version 4.0
*/
class DumpDatabaseTask extends Task implements ShellCommandServiceAwareInterface
{
use ShellCommandServiceAwareTrait;

public function execute(Node $node, Application $application, Deployment $deployment, array $options = []): void
{
$this->logger->warning('This task is deprecated and will be remove in Version 4.0');
$options = $this->configureOptions($options);

$dumpCommand = new Process([
Expand Down
4 changes: 4 additions & 0 deletions src/Task/Git/PushTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@
* ]
* );
*/
/**
* @deprecated Will be removed in version 4.0
*/
class PushTask extends Task implements ShellCommandServiceAwareInterface
{
use ShellCommandServiceAwareTrait;

public function execute(Node $node, Application $application, Deployment $deployment, array $options = []): void
{
$this->logger->warning('This task is deprecated and will be remove in Version 4.0');
$options = $this->configureOptions($options);

$targetPath = $deployment->getApplicationReleasePath($node);
Expand Down
4 changes: 4 additions & 0 deletions src/Task/Git/TagTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@
* ]
* );
*/
/**
* @deprecated Will be removed in version 4.0
*/
class TagTask extends Task implements ShellCommandServiceAwareInterface
{
use ShellCommandServiceAwareTrait;

public function execute(Node $node, Application $application, Deployment $deployment, array $options = []): void
{
$this->logger->warning('This task is deprecated and will be remove in Version 4.0');
$this->validateOptions($options);
$options = $this->processOptions($options, $deployment);

Expand Down

0 comments on commit e5f340b

Please sign in to comment.