Execute this task

@param \TYPO3\Surf\Domain\Model\Node $node
@param \TYPO3\Surf\Domain\Model\Application $application
@param \TYPO3\Surf\Domain\Model\Deployment $deployment
@param array $options
167983
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $this->checkOptionsForValidity($options);
        $host = $options['releaseHost'];
        $login = $options['releaseHostLogin'];
        $sitePath =  $options['releaseHostSitePath'];
        $version = $options['version'];
        $label = $options['label'];
        $uriPattern = $options['downloadUriPattern'];
        $productName = $options['productName'];
        $files = $options['files'];

        $downloads = [];
        foreach ($files as $file) {
            $downloads[] = sprintf('"%s,%s,%s"', basename($file), sha1($file), sprintf($uriPattern, basename($file)));
        }
        $this->shell->executeOrSimulate(sprintf('ssh %s%s "cd \"%s\" ; ./flow release:adddownload --product-name \"%s\" --version \"%s\" --label \"%s\" %s"', ($login ? $login . '@' : ''), $host, $sitePath, $productName, $version, $label, implode(' ', $downloads)), $node, $deployment);
    }
710851
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $releaseIdentifier = $deployment->getReleaseIdentifier();
        $releasesPath = $application->getReleasesPath();
        $this->shell->executeOrSimulate('cd ' . $releasesPath . ' && rm -f ./previous && if [ -e ./current ]; then mv ./current ./previous; fi && ln -s ./' . $releaseIdentifier . ' ./current && rm -f ./next', $node, $deployment);
        $deployment->getLogger()->notice('<success>Node "' . $node->getName() . '" ' . ($deployment->isDryRun() ? 'would be' : 'is') . ' live!</success>');
    }
533800
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $options = $this->configureOptions($options);

        $host = $options['releaseHost'];
        $login = $options['releaseHostLogin'];
        $changeLogUri = $options['changeLogUri'];
        $sitePath =  $options['releaseHostSitePath'];
        $version = $options['version'];
        $productName = $options['productName'];

        $this->shell->executeOrSimulate(sprintf('ssh %s%s "cd \"%s\" ; ./flow release:release --product-name \"%s\" --version \"%s\" --change-log-uri \"%s\""', ($login ? $login . '@' : ''), $host, $sitePath, $productName, $version, ($changeLogUri ? $changeLogUri : '')), $node, $deployment);
    }
234966
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $replacePaths = [];
        $replacePaths['{workspacePath}'] = escapeshellarg($deployment->getWorkspacePath($application));

        if (!isset($options['command'])) {
            throw new InvalidConfigurationException('Missing "command" option for LocalShellTask', 1311168045);
        }
        $command = $options['command'];
        $command = str_replace(array_keys($replacePaths), $replacePaths, $command);

        $ignoreErrors = isset($options['ignoreErrors']) && $options['ignoreErrors'] === true;
        $logOutput = !(isset($options['logOutput']) && $options['logOutput'] === false);

        $localhost = new Node('localhost');
        $localhost->onLocalhost();

        $this->shell->executeOrSimulate($command, $localhost, $deployment, $ignoreErrors, $logOutput);
    }
485293
public function process(NodeType $nodeType, array &$configuration, array $options)
    {
        $pluginViewDefinitions = $this->pluginService->getPluginViewDefinitionsByPluginNodeType($nodeType);
        if ($pluginViewDefinitions === []) {
            return;
        }
        $configuration['ui']['inspector']['groups']['pluginViews'] = [
            'position' => '9999',
            'label' => 'Plugin Views'
        ];
        $configuration['properties']['views'] = [
            'type' => 'string',
            'ui' => [
                'inspector' => [
                    'group' => 'pluginViews',
                    'position' => '20',
                    'editor' => 'Neos.Neos/Inspector/Editors/PluginViewsEditor'
                ]
            ]
        ];
    }
202744
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        if (!empty($options['disableDeploymentTag'])) {
            return;
        }

        if (isset($options['useApplicationWorkspace']) && $options['useApplicationWorkspace'] === true) {
            $gitRootPath = $deployment->getWorkspacePath($application);
        } else {
            $gitRootPath = $deployment->getApplicationReleasePath($application);
        }

        $tagPrefix = isset($options['deploymentTagPrefix']) ? $options['deploymentTagPrefix'] : 'server-';
        $tagName = preg_replace('/[^a-zA-Z0-9-_\.]*/', '', $tagPrefix.$node->getName());
        $quietFlag = (isset($options['verbose']) && $options['verbose']) ? '' : '-q';

        if (!empty($options['nodeName'])) {
            $node = $deployment->getNode($options['nodeName']);
            if ($node === null) {
                throw new InvalidConfigurationException(
                    sprintf('Node "%s" not found', $options['nodeName']),
                    1408441582
                );
            }
        }

        $commands = [
            'cd '.escapeshellarg($gitRootPath),
            'git tag --force -- '.escapeshellarg($tagName),
            'git push origin --force '.$quietFlag.' -- '.escapeshellarg($tagName),
        ];
        $this->shell->executeOrSimulate($commands, $node, $deployment);
    }
279038
private function executeAction($id, array $options)
    {
        $action = $this->adapter->post(sprintf('%s/floating_ips/%s/actions', $this->endpoint, $id), $options);

        $action = json_decode($action);

        return new ActionEntity($action->action);
    }
500182
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $this->ensureApplicationIsTypo3Cms($application);
        try {
            $scriptFileName = $this->getConsoleScriptFileName($node, $application, $deployment, $options);
        } catch (InvalidConfigurationException $e) {
            $deployment->getLogger()->warning('TYPO3 Console script (' . $options['scriptFileName'] . ') was not found! Make sure it is available in your project, you set the "scriptFileName" option correctly or remove this task (' . __CLASS__ . ') in your deployment configuration!');
            return;
        }
        $deployment->getLogger()->warning('This task has been deprecated and will be removed in Surf 2.1. Please use SetUpExtensionsTask instead.');
        $activePackages = isset($options['activePackages']) ? $options['activePackages'] : [];
        foreach ($activePackages as $packageKey) {
            $this->executeCliCommand(
                [$scriptFileName, 'extension:activate', $packageKey],
                $node,
                $application,
                $deployment,
                $options
            );
        }
    }
663930
public function run(DeltaInterface $version, OptionsInterface $options)
    {
        if (!$this->shouldMigrate($version, $options)) {
            if ($options->isExceptionOnSkip()) {
                throw new RunnerException(sprintf(
                    'Cowardly refusing to run %s() on a delta that is already "%s" (ID: %s).',
                    $options->getDirection(),
                    $options->getDirection(),
                    $version->getId()
                ));
            }

            return false; // skip
        }

        // Dispatch MIGRATE_BEFORE
        $this->getPublisher()->publish(new MigrateBeforeEvent($version, $options, $this->getContext()));

        $version->migrate($options); // state will be changed

        // Dispatch MIGRATE_AFTER
        $event = new MigrateAfterEvent($version, $options, $this->getContext());
        $this->getPublisher()->publish($event);

        return $event;
    }
1006757
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        if (isset($options['useApplicationWorkspace']) && $options['useApplicationWorkspace'] === true) {
            $gitRootPath = $deployment->getWorkspacePath($application);
        } else {
            $gitRootPath = $deployment->getApplicationReleasePath($application);
        }

//		$quietFlag = (isset($options['verbose']) && $options['verbose']) ? '' : '-q';

        if (!empty($options['nodeName'])) {
            $node = $deployment->getNode($options['nodeName']);
            if ($node === null) {
                throw new InvalidConfigurationException(
                    sprintf('Node "%s" not found', $options['nodeName']),
                    1413298085
                );
            }
        }

        $commands = [
            'cd '.escapeshellarg($gitRootPath),
            'if [ -d \'.git\' ] && hash git 2>/dev/null; then '.
//				'git clean ' . $quietFlag . ' -d -ff && ' .
            'git checkout -- .; '.
            'fi;',
        ];

        $this->shell->executeOrSimulate($commands, $node, $deployment);
    }
1240597
protected function executeOrSimulate(
        Node $node,
        Application $application,
        Deployment $deployment,
        array $options = []
    ) {
        if (empty($options['clearPhpCacheUris'])) {
            return;
        }
        $uris = is_array($options['clearPhpCacheUris']) ? $options['clearPhpCacheUris'] : [$options['clearPhpCacheUris']];
        foreach ($uris as $uri) {
            $deployment->getLogger()->log('... (localhost): curl "'.$uri.'"', LOG_DEBUG);
            if ($deployment->isDryRun() === false) {
                $this->browser->request($uri);
            }
        }
    }
607268
protected function determineWorkingDirectoryAndTargetNode(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        if (!isset($this->workingDirectory, $this->targetNode)) {
            if (isset($options['useApplicationWorkspace']) && $options['useApplicationWorkspace'] === true) {
                $this->workingDirectory = $deployment->getWorkspacePath($application);
                $node = $deployment->getNode('localhost');
            } else {
                $this->workingDirectory = $deployment->getApplicationReleasePath($application);
            }
            $this->targetNode = $node;
        }
    }
47195
public function afterSave($event, $entity, $options)
    {
        $fields = $this->getFieldList();
        $storedToSave = [];
        foreach ($fields as $field => $data) {
            if ($this->_ifUploaded($entity, $field)) {
                if ($this->_uploadFile($entity, $field)) {
                    if (!key_exists($field, $this->_savedFields)) {
                        $this->_savedFields[$field] = true;
                        $storedToSave[] = $this->_setUploadColumns($entity, $field);
                    }
                }
            }
        }
        foreach ($storedToSave as $toSave) {
            $event->subject()->save($toSave);
        }
        $this->_savedFields = [];
    }
951269
public function rollback(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $this->configureOptions($options);
    }
47192
protected function packageExists($packageKey, Node $node, CMS $application, Deployment $deployment, array $options = [])
    {
        $webDirectory = isset($options['webDirectory']) ? trim($options['webDirectory'], '\\/') : '';
        return $this->directoryExists($webDirectory . '/typo3conf/ext/' . $packageKey, $node, $application, $deployment, $options);
    }
617116
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        if (empty($options['branch']) || !empty($options['tag'])) {
            return;
        }

        $quietFlag = (isset($options['verbose']) && $options['verbose']) ? '' : '-q';

        $commands = [];
        $commands[] = 'cd '.escapeshellarg($deployment->getApplicationReleasePath($application));
        $commands[] = 'if [ -d \'.git\' ] && hash git 2>/dev/null; then '.
            'git branch -f '.escapeshellarg($options['branch']).' deploy && '.
            'git checkout '.$quietFlag.' '.escapeshellarg($options['branch']).' && '.
            'git branch -D deploy; '.
            'fi;';

        $this->shell->executeOrSimulate($commands, $node, $deployment);
    }
1109077
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        try {
            $commands = $this->buildCommands(
                $deployment,
                $application,
                $options
            );
            $this->shell->executeOrSimulate($commands, $node, $deployment);
        } catch (CommandProviderException $e) {
            $deployment->getLogger()->log('Task was skipped! Reason: ' . $e->getMessage(), LOG_WARNING);
        }
    }