<?php

use TYPO3\Surf\Domain\Model\Workflow;
use TYPO3\Surf\Domain\Model\Node;
use TYPO3\Surf\Domain\Model\SimpleWorkflow;
$application = new \Famelo\Surf\SharedHosting\Application\Flow();
$application->setOption('repositoryUrl', '{repositoryUrl}');
$application->setDeploymentPath('{directory}');
$application->setOption('keepReleases', 3);
$application->setOption('defaultContext', 'Production');
$application->setOption('composerCommandPath', '/html/composer.phar');
$application->setHosting('Mittwald');
$application->setOption('transferMethod', 'rsync');
$application->setOption('packageMethod', 'git');
$application->setOption('updateMethod', NULL);
$deployment->addApplication($application);
$workflow = new SimpleWorkflow();
$workflow->setEnableRollback(FALSE);
$workflow->afterTask('typo3.surf:typo3:flow:copyconfiguration', array('famelo.surf.sharedhosting:downloadbeard', 'famelo.surf.sharedhosting:beardpatch'), $application);
$deployment->setWorkflow($workflow);
$node = new Node('{host}');
$node->setHostname('{host}');
$node->setOption('username', '{user}');
$application->addNode($node);
$deployment->addApplication($application);
Exemplo n.º 2
0
<?php

use TYPO3\Surf\Domain\Model\Node;
use TYPO3\Surf\Domain\Model\SimpleWorkflow;
$application = new \TYPO3\Surf\Application\TYPO3\Flow();
$application->setOption('repositoryUrl', 'git@github.com:langeland/Distributions-IoTDemo.git');
$application->setOption('localPackagePath', FLOW_PATH_DATA . 'Checkout' . DIRECTORY_SEPARATOR . $deployment->getName() . DIRECTORY_SEPARATOR . 'Live' . DIRECTORY_SEPARATOR);
$application->setOption('composerCommandPath', 'composer');
$application->setOption('transferMethod', 'rsync');
$application->setOption('packageMethod', 'git');
$application->setOption('updateMethod', NULL);
$application->setContext('Production');
$application->setDeploymentPath('/home/hostroot/sites/langeland/iotdemo');
$application->setOption('keepReleases', 2);
$deployment->addApplication($application);
$workflow = new SimpleWorkflow();
$workflow->setEnableRollback(TRUE);
// Prevent local Settings.yaml from being transferred
$workflow->defineTask('typo3.surf:shell:removeLocalConfiguration', 'typo3.surf:shell', array('command' => 'cd "{releasePath}" && rm -f Configuration/Settings.yaml'));
$workflow->beforeStage('migrate', array('typo3.surf:shell:removeLocalConfiguration'), $application);
// Remove resource links since they're absolute symlinks to previous releases (will be generated again automatically)
$workflow->defineTask('typo3.surf:shell:unsetResourceLinks', 'typo3.surf:shell', array('command' => 'cd {releasePath} && rm -rf Web/_Resources/Persistent/*(N)'));
$workflow->beforeStage('switch', array('typo3.surf:shell:unsetResourceLinks'), $application);
$workflow->afterStage('switch', 'typo3.surf:typo3:flow:publishresources', $application);
// Clear PHP 5.5+ OpCache (required for php-fpm)
//$resetScriptFilename = 'surf-opcache-reset-' . uniqid() . '.php';
//$workflow->defineTask('fn:clearopcache',
//	'typo3.surf:shell',
//	array('command' => 'cd {currentPath}/Web && echo "<?php if (function_exists(\"opcache_reset\")) { opcache_reset(); } @unlink(__FILE__); echo \"cache cleared\";" > ' . $resetScriptFilename . ' && curl -s "http://kmcpr-live.lombard.pil.dk/' . $resetScriptFilename . '" && rm -rf ' . $resetScriptFilename)
//);
//$workflow->afterStage('switch', array('fn:clearopcache'), $application);