-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueueRuns.php
More file actions
25 lines (24 loc) · 849 Bytes
/
queueRuns.php
File metadata and controls
25 lines (24 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require( "config.php" );
$log = '/var/www/web-animations-test-infrastructure/logfile.txt';
$fp = fopen($log, 'a') or exit("Can't open $log!");
fwrite($fp, "new test" . PHP_EOL);
$payload = isset($_POST["payload"]) ? $_POST["payload"] : "";
if($payload != ""){
$payload = json_decode($payload, true);
$commits = $payload["commits"];
foreach ($commits as $commit) {
$queuedRun = new QueuedRun;
$a = array("sha1" => $commit["id"], "commitMessage" => $commit["message"]);
$p = $queuedRun -> createEntry($a);
fwrite($fp, "$p" . PHP_EOL);
}
$nextRun = QueuedRun::getNextRun();
$a = $nextRun -> commitMessage;
fwrite($fp, "$a" . PHP_EOL);
fwrite($fp, "trigger tests bash being called" . PHP_EOL);
exec("curl http://14.200.8.150/web-animations-test-infrastructure/triggerTests.php");
} else {
echo "failure";
}
?>