diff --git a/app/Http/Controllers/Admin/MaintenanceController.php b/app/Http/Controllers/Admin/MaintenanceController.php index 82fe3c78..eb6c08fe 100644 --- a/app/Http/Controllers/Admin/MaintenanceController.php +++ b/app/Http/Controllers/Admin/MaintenanceController.php @@ -36,7 +36,7 @@ class MaintenanceController extends Controller return view('admin.maintenance.index', [ 'cron_path' => $this->cronSvc->getCronExecString(), 'cron_problem_exists' => $this->cronSvc->cronProblemExists(), - 'new_version' => true, //$this->kvpRepo->get('new_version_available', false), + 'new_version' => $this->kvpRepo->get('new_version_available', false), 'new_version_tag' => $this->kvpRepo->get('latest_version_tag'), ]); } diff --git a/app/Services/VersionService.php b/app/Services/VersionService.php index 422a1825..05e05268 100644 --- a/app/Services/VersionService.php +++ b/app/Services/VersionService.php @@ -93,15 +93,18 @@ class VersionService extends Service } $include_prerelease = setting('general.check_prerelease_version', false); + Log::info('Include prerelease='.$include_prerelease); foreach ($releases as $release) { if ($release['prerelease'] === true) { if ($include_prerelease) { Log::info('Found latest pre-release of '.$release['tag_name']); + return $this->setLatestRelease( $release['tag_name'], $this->getGithubAsset($release) ); } + continue; } @@ -206,15 +209,18 @@ class VersionService extends Service $current_version = $this->cleanVersionString($current_version); } - // Replace "dev" with "alpha", since $latest_version = $this->getLatestVersion(); + Log::info('Current version='.$current_version.'; latest detected='.$latest_version); + // No new/released version found if (empty($latest_version)) { + $this->kvpRepo->save('new_version_available', false); return false; } // Convert to semver if ($this->isGreaterThan($latest_version, $current_version)) { + Log::info('Latest version "'.$latest_version.'" is greater than "'.$current_version.'"'); $this->kvpRepo->save('new_version_available', true); return true; } diff --git a/modules/Updater/Http/Controllers/UpdateController.php b/modules/Updater/Http/Controllers/UpdateController.php index 77ad6fc1..c283d929 100644 --- a/modules/Updater/Http/Controllers/UpdateController.php +++ b/modules/Updater/Http/Controllers/UpdateController.php @@ -131,7 +131,12 @@ class UpdateController extends Controller public function update_download(Request $request) { $version = $this->kvpRepo->get('latest_version_tag'); - $this->updateManager->source('github')->update($version); + if (empty($version)) { + return view('updater::steps/step1-no-update'); + } + + $release = $this->updateManager->source('github')->fetch($version); + $this->updateManager->source('github')->update($release); Log::info('Update completed to '.$version.', redirecting'); return redirect('/update'); diff --git a/resources/views/admin/maintenance/update.blade.php b/resources/views/admin/maintenance/update.blade.php index 21adf1a1..3caea948 100644 --- a/resources/views/admin/maintenance/update.blade.php +++ b/resources/views/admin/maintenance/update.blade.php @@ -6,8 +6,13 @@
-
+
+

Force new version check

+ {{ Form::open(['route' => 'admin.maintenance.forcecheck']) }} + {{ Form::button('Force update check', ['type' => 'submit', 'class' => 'btn btn-success']) }} + {{ Form::close() }} +
@if ($new_version)

An update to version {{ $new_version_tag }} is available.

@@ -18,12 +23,6 @@

There is no new version available

@endif
-
-

Force new version check

- {{ Form::open(['route' => 'admin.maintenance.forcecheck']) }} - {{ Form::button('Force update check', ['type' => 'submit', 'class' => 'btn btn-success']) }} - {{ Form::close() }} -