com web/rmtools: finally, catch pecl upload statuses and prepare for pickle build as well: client/script/pecl.php client/script/pickle.php
| From: | Anatol Belski | Date: | Sun, 23 Oct 2016 23:32:29 +0000 |
| Subject: | com web/rmtools: finally, catch pecl upload statuses and prepare for pickle build as well: client/script/pecl.php client/script/pickle.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-25937@lists.php.net to get a copy of this message | ||
Commit: c3033094a5e0fb13fa8d384a6cec1e4a56faa9fb
Author: Anatol Belski <ab@php.net> Mon, 24 Oct 2016 01:32:29 +0200
Parents: 4f906c103930e2c845cef04f4f537971f3703e13
Branches: master pecl_legacy
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=c3033094a5e0fb13fa8d384a6cec1e4a56faa9fb
Log:
finally, catch pecl upload statuses and prepare for pickle build as well
Changed paths:
M client/script/pecl.php
M client/script/pickle.php
Diff:
diff --git a/client/script/pecl.php b/client/script/pecl.php
index 149a87b..4538e8c 100644
--- a/client/script/pecl.php
+++ b/client/script/pecl.php
@@ -107,6 +107,8 @@ $was_errors = false;
echo "Using <$pkg_path>" .. PHP_EOL . PHP_EOL;
+$upload_status = array();
+
/* Each windows configuration from the ini for the given PHP version will be built */
foreach ($builds as $build_name) {
@@ -339,13 +341,14 @@ foreach ($builds as $build_name) {
if (rm\upload_pecl_pkg_ftp_curl($pkgs_to_upload, array($logs_zip), $target)) {
echo "Upload succeeded" . PHP_EOL;
} else {
- echo "Upload failed" .. PHP_EOL;
+ throw new Exception("Upload failed");
}
} catch (Exception $e) {
echo 'Error . ' . $e->getMessage() . PHP_EOL;
$upload_success = false;
}
}
+ $upload_status[$build_name] = $upload_success;
if ($mail_maintainers) {
try {
@@ -440,13 +443,17 @@ if ($is_last_run) {
$open .= "For each build combination and status please refer to the list below.";
$close = "";
- if ($upload && isset($upload_success)) {
+ if ($upload) {
+ $all_uploads_succeeded = true;
+ foreach ($upload_status as $st) {
+ $all_uploads_succeeded = $all_uploads_succeeded && $st;
+ }
$close = "Upload status: ";
- if ($upload_success) {
+ if ($all_uploads_succeeded) {
$close .= "succceeded\n";
$close .= "URL: $url\n\n";
} else {
- $close .= "failed\n\n";
+ $close .= "some uploads failed\n\n";
}
}
$close .= "This mail is being sent to you because you are the lead developer in
package.xml\n\n";
diff --git a/client/script/pickle.php b/client/script/pickle.php
index dcb55e1..585692b 100644
--- a/client/script/pickle.php
+++ b/client/script/pickle.php
@@ -69,6 +69,8 @@ $was_errors = false;
echo "Using <$pkg_path>" . PHP_EOL . PHP_EOL;
+$upload_status = array();
+
foreach ($builds as $build_name) {
$build_error = 0;
@@ -166,13 +168,15 @@ foreach ($builds as $build_name) {
unlink($pkg_file);
}
} else {
- echo "Upload failed" . PHP_EOL;
+ throw new Exception("Upload failed");
}
} catch (Exception $e) {
echo 'Error . ' . $e->getMessage() . PHP_EOL;
$upload_success = false;
}
}
+ /* keep recording upload status for every package, the code at the end is going to evaluate it
like in pecl. */
+ $upload_status[$build_name] = $upload_success;
/* notify pickle */