Skip to content

Commit

Permalink
better upgrade notification experience
Browse files Browse the repository at this point in the history
  • Loading branch information
daveajones committed Sep 26, 2019
1 parent 51dee3b commit 59adf49
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
5 changes: 0 additions & 5 deletions bin/confcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,6 @@
echo $output;
}

//Log the upgrade
if ($action == "upgrade") {
add_admin_log_item("System was upgraded from version $version", "System Upgrade");
}

echo "\n";

//Remove the lock file
Expand Down
15 changes: 13 additions & 2 deletions bin/getversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
if (($pid = cronHelper::lock()) !== FALSE) {

$action = "";
$rawver = FALSE;
if (in_array("checknew", $argv)) {
$action = "checknew";
}
if (in_array("raw", $argv)) {
$rawver = TRUE;
}
$myVersion = $cg_sys_version;

$alreadynotified = FALSE;

echo "Running version: [$myVersion]\n";
if($rawver) {
echo "$myVersion";
} else {
echo "Running version: [$myVersion]\n";
}

if( $action == "checknew" ) {
//See if there is a new version
Expand Down Expand Up @@ -42,7 +50,10 @@
}
}
if(!$alreadynotified) {
add_admin_log_item("A new version of cartulary is available: [$ghVersion]. You are currently on version: [$myVersion].", "Upgrade Available");
$upgmessage = "A new version of cartulary is available: [$ghVersion].\n\nYou are currently on version: [$myVersion].\n\n";
$releasenotes = fetchUrlSafe($cg_sys_master_release_url_prefix."v".$ghVersion."-notes.txt");
$upgmessage .= $releasenotes;
add_admin_log_item('<pre>'.$upgmessage.'</pre>', "Upgrade Available");
}
loggit(3, "New version of cartulary available: [$ghVersion]");
echo "A new version is available: $ghVersion\n";
Expand Down
6 changes: 5 additions & 1 deletion releases/v0.7.8-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ echo " This could take a while since it checks error/dead feeds too. Please wa
cd $CARTROOT/aggrivate
sudo node ./aggrivate.js checkerror force
sudo node ./aggrivate.js checkdead force
suod node ./aggrivate.js force
suod node ./aggrivate.js force

##: Log the upgrade
CARTVER=`sudo php /opt/cartulary/bin/getversion.php raw`
sudo php /opt/cartulary/bin/admin_notify.php --content="System was upgraded to version: v$CARTVER" --title="System Upgrade"

0 comments on commit 59adf49

Please sign in to comment.