Campustream 1.0
A social network MQP for WPI
application/tasks/capistrano.php
Go to the documentation of this file.
00001 <?php
00002 
00003 desc("Wrapper for running the hub task over capistrano instead of locally");
00004 task("capistrano", function( $args, $server=false) {
00005 
00006         $req_task = $args[0];
00007 
00008         try {
00009                 
00010                 HubTasks::lookup_task_by_name( $req_task );
00011                 
00012                 $host = (!empty($server)) ? "HOSTS={$server}" : false;
00013                 
00014                 $args_list = join(" ", $args);
00015                 system( "cap {$host} hub:invoke -s hub_args='{$args_list} --capified'\n" );
00016                 
00017         } catch(Exception $e) {
00018                 echo "Task doesn't exist locally, so it probably doesn't exist remotely.\n";
00019         }
00020 
00021 });