1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Fixes for self-updater (#3313)

* Include Self-Update mailers

* Fixes for self-update
This commit is contained in:
David Bomba 2020-02-12 13:51:43 +11:00 committed by GitHub
parent be3ade65f1
commit caa47d8662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,65 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
class ArtisanUpgrade extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ninja:post-update';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Run basic upgrade commands';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
exec("composer install");
try {
Artisan::call('migrate');
}catch(Exception $e) {
\Log::error("I wasn't able to migrate the data.");
}
try {
Artisan::call('optimize');
}catch(Exception $e) {
\Log::error("I wasn't able to optimize.");
}
\Log::error("finished upgrade post");
}
}

View File

@ -120,7 +120,9 @@ return [
//]
],
'post_update' => [
'postupdate:cleanup' => [
'class' => \App\Console\Commands\ArtisanUpgrade::class,
],
],
],

View File

@ -0,0 +1,5 @@
Hello!
The new version {{ $newVersion }} is available.
Kind regards