Skip to content

Instantly share code, notes, and snippets.

@mauris
Created October 21, 2012 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauris/3925647 to your computer and use it in GitHub Desktop.
Save mauris/3925647 to your computer and use it in GitHub Desktop.
Test Agent - Pull, Detect, Test
#!/usr/bin/env php
<?php
if($argc > 1){
chdir($argv[1]);
}
echo "Test Agent\n";
echo "Updating repository...";
exec('git pull --quiet');
echo " done!\n";
echo "Detecting test script...";
$script = trim(shell_exec('grep "^script: *" .travis.yml'));
echo " done!\n";
$script = substr($script, 8);
echo "Executing test $script...\n";
echo shell_exec($script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment