SismoFinder + Sismo + Agile PHP Projects

Get SismoFinder local:

mkdir sismoFinder
git clone https://github.com/havvg/SismoFinder.git .
git submodule init
git submodule update --recursive

We will modify the sismo configuration to the following always noticing to change the path to sismoFinder source. Here I have placed sismoFinder folder at the same level than any of my project folders. So everything for me is currently under sites-2 folder and that is where I have placed it:

$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array(
    'SismoFinder' => '/home/cordoval/sites-2/sismoFinder/src',
));
$loader->register();
 
$finder = new \SismoFinder\Finder();
$finder->addWorkspace('/home/cordoval/sites-2');
 
return $finder->getProjects();

Then at the project level we have the following configuration:

<?php
 
$notifier = new Sismo\DBusNotifier();
 
$graciaName = 'gracia';
 
$gracia = new Sismo\Project($graciaName);
$gracia->setRepository('/home/cordoval/sites-2/'.$graciaName);
$gracia->setBranch('develop');
$gracia->setCommand('/home/cordoval/sites-2/'.$graciaName.'/sismo');
$gracia->setSlug($graciaName);
//$gracia->setUrlPattern('http://sismo.local/'.$graciaName.'/commit/%commit%');
$gracia->setUrlPattern('http://localhost:8000/?p=.git;a=commitdiff;h=%commit%');
$gracia->addNotifier($notifier);
 
return $gracia;

And we also have our custom script which determines the command that sismo will run:

$gracia->setCommand('/home/cordoval/sites-2/'.$graciaName.'/sismo');

For our case we have called sismo as well. However when having many tasks or branches we could call it different names and have different hooks that will act upon command too. I have a git post-commit hook that triggers sismo with a name for the branch/action that needs to be build with respective sha1. We don’t want to touch the post-commit hook and have it as generic as possible and only touch the main script that is defined in the local project configuration sismo.config.php and have this and the command script decide what to do.

Leave a Reply

Your email address will not be published. Required fields are marked *