[Flow] TYPO3.Surf with Bitbucket

Peter Horn p.horn at bitmotion.de
Tue May 26 10:31:47 CEST 2015


I felt reminded on a XKCD comic (xkcd.com/979/) when reading this thread. Having a problem with using TYPO3.Surf and Bitbucket, too, I thought it might be a good idea to share what I found out.

This is the setup:

- A private repository on Bitbucket
- A build server (executing the deployment)
- A target machine (where the repository is actually going to be deployed)

TYPO3.Surf is run on the build server as a user which has SSH access (with private key authentication) to the target machine. In example and other words "mate at building" has SSH access to "dude at testing". If the username differs on the target machine from the build server (like in the example), you must specify it in TYPO3.Surf deployment configuration via setting the "username" option (in case of the example to "dude").

Because TYPO3.Surf executes Git on the target machine (if you do not configure it differently) you must register the public key of the user ("dude at testing", following the above example) as a deployment key on Bitbucket. You can verify it to be working by manually executing "git ls-remote git (at) bitbucket.org:team/project.git refs/heads/master | awk '{print $1}'" in the target machine.

See this example deployment configuration:

<?php

$node = new \TYPO3\Surf\Domain\Model\Node('testing');
$node->setHostname('testing.local');
$node->setOption('username', 'dude');

$application = new \TYPO3\Surf\Application\TYPO3\Flow();
$application->setDeploymentPath('/home/dude/deployed');
$application->setOption('repositoryUrl', 'git (at) bitbucket.org:team/project');
$application->setOption('composerCommandPath', '/usr/local/bin/composer');
$application->addNode($node);

$deployment->addApplication($application);
-- 
Best regards,

Peter


More information about the Flow mailing list