Ask for confirmation before deploying
This commit is contained in:
parent
a3ee7d10a8
commit
be6d443a13
|
@ -8,6 +8,7 @@
|
|||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use function Laravel\Prompts\confirm;
|
||||
use function Laravel\Prompts\progress;
|
||||
|
||||
class Render extends Command
|
||||
|
@ -60,13 +61,15 @@ public function handle()
|
|||
|
||||
$progress->finish();
|
||||
|
||||
$this->output->write('Deploying... ');
|
||||
$source = Str::finish(Storage::disk(env('DIST_DISK'))->path('/'), '/');
|
||||
$target = env('DEPLOY_TARGET');
|
||||
if (confirm('Ready to deploy?')) {
|
||||
$this->output->write('Deploying... ');
|
||||
$source = Str::finish(Storage::disk(env('DIST_DISK'))->path('/'), '/');
|
||||
$target = env('DEPLOY_TARGET');
|
||||
|
||||
$command = sprintf('rsync -az -L --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --chown=caddy:caddy --delete "%s" "%s"', $source, $target);
|
||||
$command = sprintf('rsync -az -L --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --chown=caddy:caddy --delete "%s" "%s"', $source, $target);
|
||||
|
||||
Process::run($command)->throw();
|
||||
$this->info('OK');
|
||||
Process::run($command)->throw();
|
||||
$this->info('OK');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user