protected function execute(InputInterface $input, OutputInterface $output) { $task = $input->getOption('task'); $event = new Deploy\Event\Event(); // $eventInput = new ArrayInput(array('env' => $this->_services['env'])); $event->setInput($input); $event->setOutput($output); $event->setCommandCollection($this->_services['console.commands']); if ($input->getOption('before')) { $this->get('event.dispatcher')->dispatch('cog.deploy.before.' . $task, $event); } else { $this->get('event.dispatcher')->dispatch('cog.deploy.after.' . $task, $event); } }
/** * Dump and generate the assets on deploy. * * @param DeployEvent $event */ public function generateAssetsOnDeploy(DeployEvent $event) { $event->executeCommand('asset:dump'); $event->executeCommand('asset:generate'); }
/** * Run the migrations on deploy. * * @param DeployEvent $event */ public function runMigrations(DeployEvent $event) { $event->executeCommand('migrate:install'); // Ensure migrations are set up $event->executeCommand('migrate:run'); }
protected function execute(InputInterface $input, OutputInterface $output) { $event = new Deploy\Event\Event(); $event->setOutput($output); $this->get('event.dispatcher')->dispatch('cog.deploy.permissions', $event); }