Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeployMarker.php
Go to the documentation of this file.
1 <?php
7 
8 use Symfony\Component\Console\Command\Command;
9 use Symfony\Component\Console\Input\InputInterface;
10 use Symfony\Component\Console\Output\OutputInterface;
11 use Symfony\Component\Console\Input\InputArgument;
12 use Magento\NewRelicReporting\Model\Apm\DeploymentsFactory;
14 
15 class DeployMarker extends Command
16 {
20  private $deploymentsFactory;
21 
25  private $serviceShellUser;
26 
34  public function __construct(
35  DeploymentsFactory $deploymentsFactory,
36  ServiceShellUser $serviceShellUser,
37  $name = null
38  ) {
39  $this->deploymentsFactory = $deploymentsFactory;
40  $this->serviceShellUser = $serviceShellUser;
41  parent::__construct($name);
42  }
43 
47  protected function configure()
48  {
49  $this->setName("newrelic:create:deploy-marker");
50  $this->setDescription("Check the deploy queue for entries and create an appropriate deploy marker.")
51  ->addArgument(
52  'message',
53  InputArgument::REQUIRED,
54  'Deploy Message?'
55  )
56  ->addArgument(
57  'change_log',
58  InputArgument::REQUIRED,
59  'Change Log?'
60  )
61  ->addArgument(
62  'user',
63  InputArgument::OPTIONAL,
64  'Deployment User'
65  );
66  parent::configure();
67  }
68 
72  protected function execute(InputInterface $input, OutputInterface $output)
73  {
74  $this->deploymentsFactory->create()->setDeployment(
75  $input->getArgument('message'),
76  $input->getArgument('change_log'),
77  $this->serviceShellUser->get($input->getArgument('user'))
78  );
79  $output->writeln('<info>NewRelic deployment information sent</info>');
80  }
81 }
execute(InputInterface $input, OutputInterface $output)
__construct(DeploymentsFactory $deploymentsFactory, ServiceShellUser $serviceShellUser, $name=null)
if(!isset($_GET['name'])) $name
Definition: log.php:14