summaryrefslogtreecommitdiffstats
path: root/WebPush
diff options
context:
space:
mode:
Diffstat (limited to 'WebPush')
-rw-r--r--WebPush/index.php37
-rw-r--r--WebPush/upload.php47
2 files changed, 40 insertions, 44 deletions
diff --git a/WebPush/index.php b/WebPush/index.php
index ab018bf27..56193ebf7 100644
--- a/WebPush/index.php
+++ b/WebPush/index.php
@@ -22,14 +22,15 @@ $build = $_GET['buildid'];
$branch = $_GET['branch'];
$version = $_GET['version'];
-if ($build == "" || $branch == "" || $version == "")
-{
- die();
+include('../build/function.php');
+updateval($branch);
+
+if ($build == "" || $branch == "" || $version == "") {
+ die('Invalid');
}
//Don't upload dev builds atm.
-if ($branch == "bt2")
-{
+if ($branch == "bt2") {
die();
}
@@ -37,16 +38,22 @@ sleep(60);
$changes = getChanges($build, $branch);
-uploadit($build, $branch, 'Essentials.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsChat.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsSpawn.jar', $version, $changes);
+//uploadit($build, $branch, 'Essentials.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsChat.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsSpawn.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsProtect.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsXMPP.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsGeoIP.jar', $version, $changes);
+
+uploadit($build, $branch, 'Essentials.zip', $version, $changes);
sleep(1);
-uploadit($build, $branch, 'EssentialsProtect.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsXMPP.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsGeoIP.jar', $version, $changes);
+uploadit($build, $branch, 'Essentials-extra.zip', $version, $changes);
+
+
?>
diff --git a/WebPush/upload.php b/WebPush/upload.php
index cf5c2112e..f971062ed 100644
--- a/WebPush/upload.php
+++ b/WebPush/upload.php
@@ -1,35 +1,32 @@
<?php
+
include_once('simple_html_dom.php');
-function uploadit($build, $branch, $file, $version, $changes)
-{
+function uploadit($build, $branch, $file, $version, $changes) {
file_put_contents('status.log', "\nUploading file $file to devbukkit! ", FILE_APPEND);
$slug = "essentials";
$plugin = "Essentials";
$url = "http://ci.earth2me.net/guestAuth/repository/download/$branch/$build:id/$file";
$filename = explode('.', $file);
$request_url = "http://dev.bukkit.org/server-mods/$slug/upload-file.json";
-
+
include ('apikey.php');
-
+
$params['name'] = $filename[0] . '-' . $version;
$params['game_versions'] = 176;
$params['change_log'] = $changes;
$params['change_markup_type'] = "html";
$params['fileurl'] = $url;
-
- if (stripos($version, 'Dev') !== false)
- {
+
+ if (stripos($version, 'Dev') !== false) {
$params['file_type'] = "a";
}
- elseif (stripos($version, 'Pre') !== false)
- {
+ elseif (stripos($version, 'Pre') !== false) {
$params['file_type'] = "b";
}
- else
- {
+ else {
$params['file_type'] = "r";
- }
+ }
$content = file_get_contents($url);
file_put_contents($file, $content);
@@ -42,13 +39,11 @@ function uploadit($build, $branch, $file, $version, $changes)
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$result = curl_exec($ch);
-
- if ($result === false)
- {
+
+ if ($result === false) {
$result = curl_error($ch);
}
- elseif ($result == "")
- {
+ elseif ($result == "") {
$result = "Success uploading $file - $version";
}
curl_close($ch);
@@ -57,8 +52,7 @@ function uploadit($build, $branch, $file, $version, $changes)
return true;
}
-function getChanges($job, $project)
-{
+function getChanges($job, $project) {
$commitblacklist = array(
'Merge branch',
'Merge pull',
@@ -72,20 +66,15 @@ function getChanges($job, $project)
$html->load_file($url);
$output = "Change Log:<ul>";
- foreach ($html->find('.changelist') as $list)
- {
- foreach ($list->find('.comment') as $comment)
- {
+ foreach ($html->find('.changelist') as $list) {
+ foreach ($list->find('.comment') as $comment) {
$text = $comment->innertext;
- foreach ($commitblacklist as $matchtext)
- {
- if (stripos($text, $matchtext) !== FALSE)
- {
+ foreach ($commitblacklist as $matchtext) {
+ if (stripos($text, $matchtext) !== FALSE) {
$text = "";
}
}
- if ($text != "")
- {
+ if ($text != "") {
$output .= "<li>$text</li>\n";
}
}