Skip to content

Instantly share code, notes, and snippets.

@radmiraal
Created May 10, 2013 21:09
Show Gist options
  • Save radmiraal/5557435 to your computer and use it in GitHub Desktop.
Save radmiraal/5557435 to your computer and use it in GitHub Desktop.
<?php
use TYPO3\Surf\Domain\Model\Node;
use TYPO3\Surf\Domain\Model\SimpleWorkflow;
$application = new \TYPO3\Surf\Application\TYPO3\Flow();
$application->setOption('version', getenv('VERSION'));
$application->setOption('repositoryUrl', getenv('REPOSITORY'));
$application->setOption('localPackagePath', FLOW_PATH_DATA . 'Checkout' . DIRECTORY_SEPARATOR . $deployment->getName() . DIRECTORY_SEPARATOR . getenv('DEPLOYMENT_NAME') . DIRECTORY_SEPARATOR);
$application->setOption('composerCommandPath', getenv('COMPOSER_PATH') ? getenv('COMPOSER_PATH') : '/usr/bin/composer');
$application->setOption('transferMethod', 'rsync');
$application->setOption('packageMethod', 'git');
$application->setOption('updateMethod', NULL);
$application->setDeploymentPath(getenv('DEPLOYMENT_PATH'));
$deployment->addApplication($application);
$workflow = new SimpleWorkflow();
$workflow->setEnableRollback(FALSE);
$deployment->setWorkflow($workflow);
$deployment->onInitialize(function() use ($workflow, $application) {
$workflow->setTaskOptions('typo3.surf:generic:createDirectories', array('directories' => array('shared/Data/Web/_Resources')));
$workflow->setTaskOptions('typo3.surf:generic:createSymlinks', array(
'symlinks' => array(
'Web/_Resources' => '../../../shared/Data/Web/_Resources/'
)
));
});
$node = new Node(getenv('DEPLOYMENT_HOST'));
$node->setHostname(getenv('DEPLOYMENT_HOST'));
$node->setOption('username', getenv('DEPLOYMENT_USER'));
$application->addNode($node);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment