Some changes

This commit is contained in:
Matthew Shillam 2018-10-16 03:19:46 +01:00
parent ad033b369b
commit 0ab36a8755
2 changed files with 30 additions and 13 deletions

View File

@ -18,8 +18,8 @@ class BackupController extends Controller
public function test()
{
$created_at = Backup::all()-> pluck('created_at');
return $created_at; }
return $created_at;
}
/**
* Store a newly created resource in storage.
@ -35,13 +35,18 @@ class BackupController extends Controller
$message = preg_replace('/\s+/', '&', $message);
parse_str($message, $data);
$schedule = Schedule::firstOrNew(array(
'client_id' => $client_id,
'name' => $schedule_name,
));
$schedule = Schedule::updateOrCreate(
['client_id' => $client_id, 'name' => $schedule_name],
['last_backup_status' => $data['ParsedResult']]
);
$schedule->last_backup_status = $data['ParsedResult'];
$schedule->save();
// $schedule = Schedule::firstOrNew(array(
// 'client_id' => $client_id,
// 'name' => $schedule_name,
// ));
// $schedule->last_backup_status = $data['ParsedResult'];
// $schedule->save();
// Sort out timestamps from $message

View File

@ -3,8 +3,11 @@ namespace Deployer;
require 'recipe/laravel.php';
set('http_user', 'panelmy');
//set('writable_use_sudo', true);
// Project name
set('application', 'domains/panel.mydentalbackup.co.uk/public_html');
set('application', '/home/panel.mydentalbackup.co.uk/public_html');
// Project repository
set('repository', 'git@git.nabble.co.uk:mshillam/mdbpanel.git');
@ -17,13 +20,13 @@ add('shared_files', []);
add('shared_dirs', []);
// Writable dirs by web server
add('writable_dirs', []);
add('writable_dirs', ['current']);
set('allow_anonymous_stats', false);
// Hosts
host('192.168.20.2')
->set('deploy_path', '~/{{application}}');
host('192.168.20.7')
->set('deploy_path', '{{application}}');
// Tasks
@ -31,10 +34,19 @@ task('build', function () {
run('cd {{release_path}} && build');
});
/**
* Chown files to correct user
*/
//task('deploy:chown', function () {
// run('chown -R panelmy:panelmy ' . get('deploy_path'));
//});
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// Migrate database before symlink new release.
//before('deploy:symlink', 'deploy:chown');
before('deploy:symlink', 'artisan:migrate');