<?php /** @var \TYPO3\Surf\Domain\Model\Deployment $deployment */ // APPLICATION $application = new \TYPO3\Surf\CMS\Application\TYPO3\CMS(); $application->setOption('projectName', 'Introduction Package'); $application->setOption('repositoryUrl', 'git://git.typo3.org/TYPO3CMS/Distributions/Introduction.git'); $application->setOption('typo3.surf:gitCheckout[branch]', 'master'); $application->setDeploymentPath('/var/www/introduction'); // NODES $node = new \TYPO3\Surf\Domain\Model\Node('Introduction Package on local system'); $node->setHostname('localhost'); $application->addNode($node); // WORKFLOW $workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow(); // DEPLOYMENT $deployment->setWorkflow($workflow); $deployment->addApplication($application);
/** * @test */ public function executeOnLocalNodeJoinsCommandsWithAndOperator() { /** @var \TYPO3\Surf\Domain\Service\ShellCommandService|\PHPUnit_Framework_MockObject_MockObject $shellCommandService */ $shellCommandService = $this->getMock('TYPO3\\Surf\\Domain\\Service\\ShellCommandService', array('executeProcess')); $node = new \TYPO3\Surf\Domain\Model\Node('TestNode'); $node->setHostname('localhost'); $deployment = new \TYPO3\Surf\Domain\Model\Deployment('TestDeployment'); /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject $mockLogger */ $mockLogger = $this->getMock('Psr\\Log\\LoggerInterface'); $deployment->setLogger($mockLogger); $shellCommandService->expects($this->any())->method('executeProcess')->with($deployment, $this->stringContains('bin/false && ls -al'))->will($this->returnValue(array(0, 'Foo'))); $response = $shellCommandService->execute(array('bin/false', 'ls -al'), $node, $deployment); $this->assertEquals('Foo', $response); }
<?php /** * VOP deployment * Created by Markus Sommer (markussom@posteo.de) */ use TYPO3\Surf\Task\LocalShellTask; use TYPO3\Surf\Task\Package\GitTask; use TYPO3\Surf\Task\ShellTask; if (!isset($settings)) { die('Keine Einstellungen gefunden'); } $node = new TYPO3\Surf\Domain\Model\Node($settings['project']['instance']); $node->setHostname($settings['server']['hostname']); $node->setOption('username', $settings['server']['username']); $application = new \TYPO3\Surf\Application\TYPO3\CMS($settings['project']['name']); $application->setOption('projectName', $settings['project']['name']); $application->setOption('repositoryUrl', $settings['project']['repository']); $application->setOption('branch', $settings['project']['branch']); $application->setOption('baseUrl', $settings['project']['url']); $application->setOption('transferMethod', 'rsync'); $application->setOption('packageMethod', 'git'); $application->setDeploymentPath($settings['server']['path']); $application->setOption('composerCommandPath', 'composer'); $application->setOption('keepReleases', 0); $application->setOption('phpBinaryPathAndFilename', '/usr/local/bin/php5-56STABLE-CLI'); $application->setSymlinks($settings['symlinks']); $application->addNode($node); // WORKFLOW $workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow(); $workflow->afterTask(GitTask::class, 'Markussom\\Vop\\DefinedTask\\LocalShell\\MoveWeb');