Skip to content

Commit

Permalink
update commands
Browse files Browse the repository at this point in the history
  • Loading branch information
alihardan committed Mar 21, 2024
1 parent d21e3ed commit cc1255f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions app/Console/Commands/UpdateDB.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Process;

class UpdateDB extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:update-db';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';

/**
* Execute the console command.
*/
public function handle()
{
Artisan::call('db:wipe');
$result = Process::run("cd /opgactions/opg-backups/ && git pull");
// echo $result->output();
// echo $result->errorOutput();
$result = Process::timeout(600)->run("mysql -u root -p1 opg < /opgactions/opg-backups/opgmanager.sql");
}
}

0 comments on commit cc1255f

Please sign in to comment.